Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I do most of my work in Access, and would like to know if there is a GotFocus
event for Excel combo boxes. I like to setup my forms to limit the users need to use the mouse, so I generally set my combo boxes to dropdown automatically in the GotFocus event of a control. I could not find this event associated with my controls (Excel 2003), so I'm trying to use the Enter event instead. This works if I click in the control, or if I am tabbing from a textbox into the combo box, but if I tab out of a control that is currently dropped down, then the next combo box doesn't drop down. If I select the item in a combo, then tab into the next combo it works properly. Any ideas? -- Email address is not valid. Please reply to newsgroup only. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
but if I tab out of a | control that is currently dropped down
That's exactly the problem. It seems that the second combo will not drop down until the first is fully closed and there seems a lag in the 'fully closed' part. But I got it to work by having the combo call another sub Ontime to do the drop down: Private Sub ComboBox2_Enter() ''//ComboBox2.DropDown Application.OnTime Now, "DoDropCombo2" End Sub ''This code MUST go in a standard module. Sub DoDropCombo2() UserForm1.ComboBox2.DropDown End Sub -- Jim "Dale Fye" wrote in message ... |I do most of my work in Access, and would like to know if there is a GotFocus | event for Excel combo boxes. I like to setup my forms to limit the users | need to use the mouse, so I generally set my combo boxes to dropdown | automatically in the GotFocus event of a control. | | I could not find this event associated with my controls (Excel 2003), so I'm | trying to use the Enter event instead. This works if I click in the control, | or if I am tabbing from a textbox into the combo box, but if I tab out of a | control that is currently dropped down, then the next combo box doesn't drop | down. If I select the item in a combo, then tab into the next combo it works | properly. | | Any ideas? | -- | Email address is not valid. | Please reply to newsgroup only. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Jim,
I guess a work-around is better than nothing. -- Email address is not valid. Please reply to newsgroup only. "Jim Rech" wrote: but if I tab out of a | control that is currently dropped down That's exactly the problem. It seems that the second combo will not drop down until the first is fully closed and there seems a lag in the 'fully closed' part. But I got it to work by having the combo call another sub Ontime to do the drop down: Private Sub ComboBox2_Enter() ''//ComboBox2.DropDown Application.OnTime Now, "DoDropCombo2" End Sub ''This code MUST go in a standard module. Sub DoDropCombo2() UserForm1.ComboBox2.DropDown End Sub -- Jim "Dale Fye" wrote in message ... |I do most of my work in Access, and would like to know if there is a GotFocus | event for Excel combo boxes. I like to setup my forms to limit the users | need to use the mouse, so I generally set my combo boxes to dropdown | automatically in the GotFocus event of a control. | | I could not find this event associated with my controls (Excel 2003), so I'm | trying to use the Enter event instead. This works if I click in the control, | or if I am tabbing from a textbox into the combo box, but if I tab out of a | control that is currently dropped down, then the next combo box doesn't drop | down. If I select the item in a combo, then tab into the next combo it works | properly. | | Any ideas? | -- | Email address is not valid. | Please reply to newsgroup only. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the Enter event. It is fired when the control gets focus.
Private Sub ComboBox1_Enter() ' your code here End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting www.cpearson.com (email on the web site) "Dale Fye" wrote in message ... I do most of my work in Access, and would like to know if there is a GotFocus event for Excel combo boxes. I like to setup my forms to limit the users need to use the mouse, so I generally set my combo boxes to dropdown automatically in the GotFocus event of a control. I could not find this event associated with my controls (Excel 2003), so I'm trying to use the Enter event instead. This works if I click in the control, or if I am tabbing from a textbox into the combo box, but if I tab out of a control that is currently dropped down, then the next combo box doesn't drop down. If I select the item in a combo, then tab into the next combo it works properly. Any ideas? -- Email address is not valid. Please reply to newsgroup only. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Click event on menu item is lost after first time firing of the event | Excel Programming | |||
OLEObject.GotFocus | Excel Programming | |||
How to trap delete row event and hide column event? | Excel Programming | |||
user form-on open event? keydown event? | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |