Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Call Event as Sub

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 857
Default Call Event as Sub

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 95
Default Call Event as Sub

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to call the event of other worksheet chad Excel Worksheet Functions 1 May 30th 07 09:48 AM
How to call an event procedure Ben Excel Programming 2 December 6th 05 05:40 PM
Open event to call procedure ONLY on Monday Steph[_3_] Excel Programming 2 December 13th 04 09:50 PM
how to call a macro from a worksheet event? lopsided[_3_] Excel Programming 5 December 16th 03 10:28 AM
call a sub with arguments from Worksheet_FollowHyperlink event Tom Ogilvy Excel Programming 5 August 28th 03 10:58 PM


All times are GMT +1. The time now is 06:44 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"