Using the NotInList event (combo)

        3 votes: ***       4,131 views      0 comments
by Allen Browne, 20 April 2005    (Access 2)

MS-Access Tips for Serious Users

Provided by (Armin Burkholder)

Using the NotInList event (combo)

The functionality of combo boxes can be extended significantly by adding a bit of code to the NotInList event which gets triggered when the LimitToList property is set to Yes and the user enters text that is not listed in the combo.

It can be made to add new records, change existing search fields, and so on. Your first line of code should be:


You can then do what you like, because you have the new value that the user typed in to the NewData parameter and the original data is still available in the field. I generally open a modal form asking if the user wishes to add a new record or change the existing one, and then take appropriate action in the recordset.

The only trick is to end the NotInList subroutine with


This forces Access to ignore the error condition which originated the trigger for the NotInList subroutine.

See also Managing Combo Boxes

This tip was supplied by (Armin Burkholder), May 16, 1995.

Rate this article:   Your rating: Poor Your rating: Not so good Your rating: Average Your rating: Good Your rating: Excellent

Have your say - comment on this article.

What did you think of 'Using the NotInList event (combo)'?

No comments yet.

Why not be the first to comment on this article?!

Have your say...

E-mail (e-mail address will be kept private)
Verify Code
Verification Code

It may take 30 seconds after clicking submit - please be patient to avoid duplicate submissions.  

All comments must be approved before being displayed on this web page.  This process may take up to 24 hours.