View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
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