By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,992 Members | 891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,992 IT Pros & Developers. It's quick & easy.

[Access 2003] problems with combobox-control and on_change

P: n/a
Hi group,
have problems with combobox-control in a form (access 2003).
I added VBA-Code to on-Change event of the control. If the user choose an
value from the control, the filter of the form change to that value.

so far it works.

problem is, it only works if the user change the (value of the) control
with the mouse. As soon as he starts pressing the keyboard, i get errors.

First i get the usual "Item not in list" messagebox but then i get an
error from the filter to. (trying to apply an useless filter).

Is there an way to check if the control has an useful value at the moment
or if the user is still typing in keys ? I want to fire the
on-change-event of the control only if the value of the control is an
value of it's control-source query.

I try the OnNotInList Function but got nowhere. Can you enlighten me
what to try next ?

thanks,
-Horst
Aug 13 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
The OnChange event, by design, triggers as soon as the first key is pressed
(or a choice is made with a mouse). In other words, as soon as the value
begins to change this event fires.
If you want to be sure the value the user enters is only from the combo
box's record source, set the combobox LimitToList property to Yes. This
will stop the user from entering an invalid choice.
Once the choice has been picked (or entered), If you want to then take some
action based on the user's choice, use the AfterUpdate Event.
"Horst JENS" <ho********@chello.atwrote in message
news:7c***************************@news.chello.at. ..
Hi group,
have problems with combobox-control in a form (access 2003).
I added VBA-Code to on-Change event of the control. If the user choose an
value from the control, the filter of the form change to that value.

so far it works.

problem is, it only works if the user change the (value of the) control
with the mouse. As soon as he starts pressing the keyboard, i get errors.

First i get the usual "Item not in list" messagebox but then i get an
error from the filter to. (trying to apply an useless filter).

Is there an way to check if the control has an useful value at the moment
or if the user is still typing in keys ? I want to fire the
on-change-event of the control only if the value of the control is an
value of it's control-source query.

I try the OnNotInList Function but got nowhere. Can you enlighten me
what to try next ?

thanks,
-Horst
Aug 13 '07 #2

P: n/a
On Mon, 13 Aug 2007 08:45:20 -0400, Len Robichaud wrote:
The OnChange event, by design, triggers as soon as the first key is pressed
(or a choice is made with a mouse). In other words, as soon as the value
begins to change this event fires.
If you want to be sure the value the user enters is only from the combo
box's record source, set the combobox LimitToList property to Yes. This
will stop the user from entering an invalid choice.
Once the choice has been picked (or entered), If you want to then take some
action based on the user's choice, use the AfterUpdate Event.

This worked great !
Thanks a lot !

-Horst
Aug 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.