form combo box to add a value to a table?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
Back
Top