Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a need to force a ComboBox_Click() event. But, I think I already know
the answer - I just don't like it. The ComboBox_Click() event populates a form. The user has the option to edit some of the controls in the form. Some of these edits will change values in other controls. Therefore, I would like to re-populate the form as if the ComboBox was clicked. The ComboBox_Change() event wasn't working in my situation. When I cleared the ComboBox, it was kicking off the Change() event and I didn't want that. This is why I used Click(). The answer I'm trying to avoid is create a sub that does everything in the ComboBox_Click() event and call it from everywhere I need. -- Adios, Clay Harryman |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Clay,
You should be able to call the Combo box click event handler just like how you would call any sub routine. Private Sub ComboBox1_Click() MsgBox "combo box 1 was clicked!" End Sub Sub test() 'Call ComboBox1_Click ComboBox1_Click End Sub -- Hope that helps. Vergel Adriano "Clayman" wrote: I have a need to force a ComboBox_Click() event. But, I think I already know the answer - I just don't like it. The ComboBox_Click() event populates a form. The user has the option to edit some of the controls in the form. Some of these edits will change values in other controls. Therefore, I would like to re-populate the form as if the ComboBox was clicked. The ComboBox_Change() event wasn't working in my situation. When I cleared the ComboBox, it was kicking off the Change() event and I didn't want that. This is why I used Click(). The answer I'm trying to avoid is create a sub that does everything in the ComboBox_Click() event and call it from everywhere I need. -- Adios, Clay Harryman |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Found the problem:
ComboBox_Click() was in another form than the one with which I had problems. I made it Public rather than Private and it worked. -- Adios, Clay Harryman "Vergel Adriano" wrote: Clay, You should be able to call the Combo box click event handler just like how you would call any sub routine. Private Sub ComboBox1_Click() MsgBox "combo box 1 was clicked!" End Sub Sub test() 'Call ComboBox1_Click ComboBox1_Click End Sub -- Hope that helps. Vergel Adriano "Clayman" wrote: I have a need to force a ComboBox_Click() event. But, I think I already know the answer - I just don't like it. The ComboBox_Click() event populates a form. The user has the option to edit some of the controls in the form. Some of these edits will change values in other controls. Therefore, I would like to re-populate the form as if the ComboBox was clicked. The ComboBox_Change() event wasn't working in my situation. When I cleared the ComboBox, it was kicking off the Change() event and I didn't want that. This is why I used Click(). The answer I'm trying to avoid is create a sub that does everything in the ComboBox_Click() event and call it from everywhere I need. -- Adios, Clay Harryman |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
how to call the event of other worksheet | Excel Worksheet Functions | |||
How to call an event procedure | Excel Programming | |||
Open event to call procedure ONLY on Monday | Excel Programming | |||
how to call a macro from a worksheet event? | Excel Programming | |||
call a sub with arguments from Worksheet_FollowHyperlink event | Excel Programming |