Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Load a ComboBox without triggering another event

I have two combo boxes. One is loaded at run time.
The second is loaded with values that depend on the user's selection in the
first one.

So the ComboBox2 should load values only after the USER selects something in
ComboBox1.

When the program is loading ComboBox1, it appears to trigger ComboBox2. I
have tried the ComboBox1_change() and ComboBox1_Click() events, but they
don't work.

I hope that makes sense...

How can I prevent ComboBox2's event from firing while combobox1 is being
loaded, but allow it to run once the user makes a selection from combobox1?

Thanks!
dan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Load a ComboBox without triggering another event

create a global, static boolean in a standard module. something like

arewethereyet

arewethereyet should be initialized to False.
ComboBox2 code should always examine arewethereyet and immediately exit if
it False. This will dismiss any accidental tripping of ComboBox2.

Have the ComboBox1 code set arewethereyet to True as the last thing it does.
This will allow ComboBox2 to run in the proper, subsequent, fashion.
ComboBox2 code should also restore arewethereyet to False prior to exit.
--
Gary''s Student - gsnu200719


"Dan" wrote:

I have two combo boxes. One is loaded at run time.
The second is loaded with values that depend on the user's selection in the
first one.

So the ComboBox2 should load values only after the USER selects something in
ComboBox1.

When the program is loading ComboBox1, it appears to trigger ComboBox2. I
have tried the ComboBox1_change() and ComboBox1_Click() events, but they
don't work.

I hope that makes sense...

How can I prevent ComboBox2's event from firing while combobox1 is being
loaded, but allow it to run once the user makes a selection from combobox1?

Thanks!
dan

  #3   Report Post  
Posted to microsoft.public.excel.programming
dan dan is offline
external usenet poster
 
Posts: 866
Default Load a ComboBox without triggering another event

So simple, so elegant, and works perfect!
Thanks a bunch.
dan

"Gary''s Student" wrote:

create a global, static boolean in a standard module. something like

arewethereyet

arewethereyet should be initialized to False.
ComboBox2 code should always examine arewethereyet and immediately exit if
it False. This will dismiss any accidental tripping of ComboBox2.

Have the ComboBox1 code set arewethereyet to True as the last thing it does.
This will allow ComboBox2 to run in the proper, subsequent, fashion.
ComboBox2 code should also restore arewethereyet to False prior to exit.
--
Gary''s Student - gsnu200719


"Dan" wrote:

I have two combo boxes. One is loaded at run time.
The second is loaded with values that depend on the user's selection in the
first one.

So the ComboBox2 should load values only after the USER selects something in
ComboBox1.

When the program is loading ComboBox1, it appears to trigger ComboBox2. I
have tried the ComboBox1_change() and ComboBox1_Click() events, but they
don't work.

I hope that makes sense...

How can I prevent ComboBox2's event from firing while combobox1 is being
loaded, but allow it to run once the user makes a selection from combobox1?

Thanks!
dan

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
workbooks.open without triggering event Vobiscum[_3_] Excel Programming 2 June 24th 05 07:21 AM
ComboBox Triggering Resourse Warning Phil Hageman[_3_] Excel Programming 3 May 26th 04 07:23 AM
Triggering an event based on reference Supriya Excel Programming 0 January 29th 04 11:50 AM
Triggering click event of a menu in vba steve Excel Programming 4 August 19th 03 06:17 PM
Triggering click event of a menu in vba Tom Ogilvy Excel Programming 0 August 18th 03 07:51 PM


All times are GMT +1. The time now is 02:34 PM.

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

About Us

"It's about Microsoft Excel"