form combo box to add a value to a table?

M

Madeleine

I have a form with a combo box, property of "limited to List" set to "no".
When the user does not find their selection in the combo box list, they type
it into the form. However, this new value does not get saved into the table
as a new value (the table from which the combo box is based).
Is there a way to allow the value to get added permanently via the form
entry, or do we have to add the new value to the table first?

thanks, Madeleine
 
S

Sprinks

Hi, Madeleine.

The following link will show you how to do this:
http://www.mvps.org/access/forms/frm0015.htm

In your form, set the combo box' Limit to List property to Yes. When the
user enters a new value, it will trigger the NotInList event, which will run
the code. For your reference, the data entered by the user is set by Access
to a system variable called NewData.

Be sure also that you have a reference to the DAO Object Library. If you've
never set a reference, enter the Visual Basic Editor (or press <Ctrl-G> for
the immediate window, and select Tools, References; then scan down and check
the DAO Object Library.

Good luck. I use this procedure all the time; works great.
Sprinks
 
M

Madeleine

still struggling w/this. I set the combo box "limit to List" property to
"yes". I also created a pop-up box for the input. However, after I enter my
new value, I am still receiving the error that the text I have entered isn't
in the combo box list.
Do not understand why I am still receiving that error. I have the else
condition Response = acDataErrAdded in the code, which should allow the new
value to be added, correct???
 
Top