Easy (I think) Drop Down Box Question

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

Guest

This question has probably been asked a hundred times, but I have searched
and searched and can't find the answer in here or in Access help.

How do I allow data entry in myy drop down box? (So people can add to it
without going into the table).

Thank you!
Tanya Lee
 
If the data that you see in the combo is actually the data in the table
(i.e. the combos does not have a hidden bound column), you can use its
NotInList event procedure to programmatically add the data to the table.
Details in:
NotInList: Adding values to lookup tables
at:
http://allenbrowne.com/ser-27.html

If the combo does have a hidden bound column, or if there are other fields
you need to add to the lookup table as well, you might consider using the
DblClick event of the combo to open the form where these entries are made.
That's just a matter of using the OpenForm action/method in the DblClick
event. But once the new entry is added, you need to Requery the combo so it
learns about the new entry. Use the AfterUpdate event of the entry form. The
line of code would be:
Forms.Form1.Combo1.Requery
 
I went to your webpage and followed your instructions but it won't work for
me. Can you explain the purpose of creating the module in Step 1? I don't see
how that module is used again (I'm unfamiliar with modules and what they do).
Am I missing something I'm supposed to do?

My dropdown box will now allow me enter a new item, but it does not save it
to the table.

Thank you again!
 
We suggest that you save the function in a standard module, so it can be
used for any combo on any form in the database.

The function saved in that module is called by the line of code in step 5.
 
Back
Top