Requery Combo Box

L

LauriS

I've done this before but for this situation I can't seem to figure out how
to do it.

I have a combo box on my form. When the user enters the box the dropdown is
activated (so they can see the options). If they enter a selection that is
not in the list I display a message box asking them if they want to add that
item to the list. If they say yes, a form appears for them to add it. When
they close that form they are taken back to the main form and I make sure the
newly added item was saved to the table.

I can't seem to figure out WHERE to put the requery action so the new item
shows up. I set the combo box value to Null in the NotInList event (after
the form coding) so it's not still showing what they entered.

Any ideas?
 
O

Ofer Cohen

Open the form that you use to insert new recods in Dialog mode, that halt the
code until that form is closed, and then run the requery

DoCmd.OpenForm "FormName", , , , , acDialog
Me.ComboName.Requery
 

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

Top