DataCombo1_Change fires when form is loaded?!?

ShorePatrol
09-04-2003, 08:16 AM
How can I prevent the DataCombo1_Change event from firing when the form is loaded????

I want this event used when a selection is made with the mouse...and it does work - but only after the event fires once when the form is loaded.

Any Advice???

Thanks!

tomcarr2
09-04-2003, 08:55 AM
I use the click event instead of the change event, use mouse_up event if you want to use a right click for context menu.

but if you must use the change event, I would create a flag, set it to true on form load, then in the change event, exit sub if true but make it false so no further events are cancelled. if you don't unload the form when you go to another, you can use the form lost focus to make the flag true again for the next time the form gets focus.

ShorePatrol
09-04-2003, 09:00 AM
I use the click event instead of the change event, use mouse_up event if you want to use a right click for context menu.

but if you must use the change event, I would create a flag, set it to true on form load, then in the change event, exit sub if true but make it false so no further events are cancelled. if you don't unload the form when you go to another, you can use the form lost focus to make the flag true again for the next time the form gets focus.


I can't use the click or mouse up event, because if the user clicks the little arrow to drop the list down, it fires......I don't want it to fire until they select something.

I was doing something like your second suggestion, but then I decided to scrap all that, and just add a small command button next to the dropdown that the user clicks when they have made their selection.

Thanks!

lodem
09-04-2003, 10:01 AM
if me.activecontrol.name <>"DataCombo1" then

endif

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum