Detect combo box selection change ?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to distinguish between the first time a combo box value is chosen as
opposed to a previous selection being changed, how would I do this? Reason
being that when changing a selection, I need to display a warning Msgbox.
 
There are a couple of ways to do this. One question, when you say "first
time", what do you really mean? First time after the form is opened? First
time for the current record? Or something else?
 
Good point, I should have been more specific.
By 'first time' I mean that a selection has never been made before - either
in the current work session or any previous work session.
I don't have to worry about a previous selection being blanked out thus
triggering a new round of 'first time'.

Thanks
 
That is a pretty hefty task. The only way I can think of to do that would
depend on whether the combo row source is table/query or a value list.
If it is a table/query, you are going to need to add a field to your table,
probably a Yes/No field defaulting to False and include it as a new column in
the combo. Then you could check the value of that column to see whether to
display the warning message.

If it is a Value List, you will still need the additional column, but you
will have to code in the values. Once the selection has been used, you will
have to recreate the value list. In this case, you would have to change
where you close the form to save design changes so the row source would
retain your changes. In fact, I think it would probably be better to create
a table just for this combo and use the method above.

In either case, I am not sure how reliable this would be in a multi-user
environment.
 
Back
Top