Which event to use to detect combo-box selection?

D

Dorian

Which is the best event to use to detect changes in a combo box selection?
I need to detect the date/time of every change to a combo box selection even
if it changes multiple times before the BeforeUpdate event.

-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
D

Dirk Goldgar

Dorian said:
Which is the best event to use to detect changes in a combo box selection?
I need to detect the date/time of every change to a combo box selection
even
if it changes multiple times before the BeforeUpdate event.


I assume by "BeforeUpdate event", you mean the BeforeUpdate event of the
form, not the combo box. But you want to know every time the user changes
selections in the combo box, even if they do it multiple times before saving
the record.

I'd use the control's AfterUpdate event for this. You certainly *don't*
want to use the Change event, because if the user types into the control
instead of using the mouse, the Change event will fire with every keystroke.
I believe you *could* use the Click event, because that event has been
jiggered to behave similarly to the AfterUpdate event; however, it seems to
me "AfterUpdate" explains itself much better.
 
J

John W. Vinson

Which is the best event to use to detect changes in a combo box selection?

The combo box's BeforeUpdate event (if you want to be able to cancel that
change), or its AfterUpdate event (if you want to do something with the value
after it's been saved to the table).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top