ComboBox NotInList Event

Rusty

Registered User.
Local time
Today, 15:40
Joined
Apr 15, 2004
Messages
207
Hello again people,

I am trying to code a NotInList event for a combo box on a form.

(The form is called "frmPROJECTS2" and the name of the combo box is "cboChiefID".

When the user tries to enter a value that is not on the list I want a message box to come up as follows:

"The name you have entered is not in the list. Would you like to add it?"

If the user clicks on "Yes" then I want to launch a form called "frmAddPerson"

If the user click on "No" then I want to clear the entry in the combobox

Any ideas? I've tried several different pieces of code but without any luck – I just get loads of error messages, and even when I do get "frmAddPerson" to launch and add the entry from there, I close the form to go back to "frmPROJECTS2" and I then get the cr@ppy default message "the text you entered isn't an item on the list…"

Is there a way of clearing the entry in the combobox and then launching the form called "frmAddPerson"?

====================================================
NB – I am doing it this way because the combo box list is a list of names and displays surname, forename and title, but returns a unique person id number. So it has about 12 different "Jones" or "Smith" listed in there but not necessarily "Bob Jones" or "Lee Smith", Therefore the frmAddPerson enables the user to enter these values in one go.
====================================================

Please help,

Rusty :D
 
Look at the Developer's Solution database that shipped with Access 97 (if you have Access 2000+, I believe you can download it from Microsoft.com). In there is sample code on how to do this very thing. I think it's the choice called "Enter/edit products".
 
I have got the notinlist to work but when I try to requery my combo box i get an error saying You must save the field first.? Any ideas? The data is being added to the table.
 

Users who are viewing this thread

Back
Top Bottom