Refreshing cmbbox lists

Sigma248

Registered User.
Local time
Today, 15:55
Joined
Oct 6, 2008
Messages
24
I am trying to refresh a cmbbox's list after opening another form and adding a value that should appear in the list, and returning to the original form.

i.e. cmbClient_Name

and I add a Client Name and details to the Names table on a pop up form then close it returning to the original form and want to refresh the cmbClient_Name list to show the new Client Name.

How do you do this?
 
Your Form that you are opening should opened in Dialog mode then after the OpenForm code you would have:

Me.cmbClient_Name.Requery


DoCmd.OpenForm "MyFormName", , , , acFormAdd, acDialog
Me.cmbClient_Name.Requery


When you open a Form in Dialog mode this way, the code halts until the Form is closed. So in other words, the Me.cmbClient_Name.Requery code line will not fire until the Form the code opened is closed.

.
 
- open your popup form in dialog mode
- add this after the line that opens the popup form:
me.cmbClient_Name.requery
 

Users who are viewing this thread

Back
Top Bottom