Not In List Messages

  • Thread starter Thread starter PeterM
  • Start date Start date
P

PeterM

I have a combobox with LIMITTOLIST = yes. I have code in the NOTINLIST event
to display a message about the error. That all works fine. The problem I
have is that AC2003 always displays a system message that the data entered is
not in the list. My question is: how do I suppress that message? I've
tried to search for the err.number in both the AFTERUPDATE and NOTINLIST
events, but the err.number is 0.

Thank You!
 
This is controlled by the Response variable.

Check the VBE Help for the 'Not In List Event' all the details are there.

"Response The setting indicates how the NotInList event was handled. The
Response argument can be one of the following intrinsic constants:

Constant Description

acDataErrDisplay (Default) Displays the default message to the user. You can
use this when you don't want to allow the user to add a new value to the
combo box list.

acDataErrContinue Doesn't display the default message to the user. You can
use this when you want to display a custom message to the user. For example,
the event procedure could display a custom dialog box asking if the user
wanted to save the new entry. If the response is Yes, the event procedure
would add the new entry to the list and set the Response argument to
acDataErrAdded. If the response is No, the event procedure would set the
Response argument to acDataErrContinue.

acDataErrAdded Doesn't display a message to the user but enables you to add
the entry to the combo box list in the NotInList event procedure. After the
entry is added, Microsoft Access updates the list by requerying the combo
box. Microsoft Access then rechecks the string against the combo box list,
and saves the value in the NewData argument in the field the combo box is
bound to. If the string is not in the list, then Microsoft Access displays an
error message."

Simply google the subject and you'll find a ton of example showing how you
work with it in your code

http://www.databasedev.co.uk/not_in_list.html
http://www.blueclaw-db.com/access_notinlist_advanced_example.htm
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
Please rate this post using the vote buttons if it was helpful.
 
Back
Top