Combo Box

R

Roger Bell

I have a combo box on the main form enabling the user to select a specific
occupation which is linked to a the row source Table in properties. The
user can type in an occupation if it is not on the combo list. What I want
is for the user to have the option of adding this new occupation
automatically to the combo list.
Thanks for any help
 
A

Allen Browne

If the value being typed into to the combo actually goes into the primary
key field of the lookup table (the list of occupations), you can use the
NotItList event of the combo, as explained here:
NotInList: Adding values to lookup tables
at:
http://allenbrowne.com/ser-27.html

But if this table has an AutoNumber primary key, so the new data is not the
value being stored, you will not be able to use NotInList. Instead, undo the
combo, and use another approach, such as executing an append query and
requerying the combo, or opening a form where the user can enter the value
and in its Form_AfterUpate event requery the combo.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Weekly Report 2
Fill In Info in cell 0
Combo box 0
Crating User Form to Add Names 1
Combo or list box 0
Dependant lists using Combo Boxes 2
Combo Boxes 1
Combo or list box 0

Top