How to refresh a drop down menu

chellebell1689

Registered User.
Local time
Today, 12:46
Joined
Mar 23, 2015
Messages
267
Hello,
I have a form for our church members and each member is assigned to a family ID. I had already put in most of the family ID's and I have a button to add a new family, but after I add the new family the drop down list doesn't show to new family, not unless I close the form and reopen it (and since this is a required field, this means I have to either mess up the numbering and force close the form, or save them to another family, then come back and save them to the correct family).

So my question is, how can I add the family and update the drop down?

Oh, the families are saved into their own table that shows information that is shared through the family (address, Deacon, etc).

Thanks in advance.
 
You could probably use the NotInList event of the combo rather than a special button (search here on "notinlist"). Keeping it like it is, add code to the close event of the family form:

Forms!ThisFormName.FamilyComboName.Requery
 
you update the dropdown by using

me.dropdown.requery

change dropdown to your dropdown name and put the code after you have added the new record
 
Thank you both! I'm going to go with CJ_London with this one, it seems a bit easier for me to do (major noob to VBA).

**Edit**
Sorry forgot to ask a quick question. Would I put this code on the form with the drop down button, or could I put it on the form that adds the new family? (Could I add it to the button that saves the new family and closes the form?)
 
Last edited:
His would be from within the first form, mine from the form that adds new families.
 
I have a thread in the sample code forum. It is called something like Refresh Combo Boxes. It is a routine that can be called to requery all combo boxes in any open form. That might help you.
 
I couldn't figure out where to put the code (from CJ), but it is currently sitting on "On Current" for the main form. I did find out, however, if I press F5 it refreshes the list. Not sure if the two have anything in common, but it works. Once I learn more about coding I'll work with the codes given to me. Thank you all very much for your help!!
 

Users who are viewing this thread

Back
Top Bottom