Updating a combo box without closing form

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

Guest

I have a form with a combo box that pulls values from a table. I also have a
button on this form to add new values into the same table. The problem is
that when I add new values into the table, those values do not show in my
combo box until I close the form and reopen it. Any fixes? Thanks
 
Ron said:
I have a form with a combo box that pulls values from a table. I also have a
button on this form to add new values into the same table. The problem is
that when I add new values into the table, those values do not show in my
combo box until I close the form and reopen it. Any fixes? Thanks

Add an event at the end of the code executed when you press the button
you mentioned. The code will be a single line that will cause the
recordsoruce of the combo to refresh.
If your combo's name is 'cboWhatever', then the code you add will be
Me.cboWhatever.Reuery

Bob
 
Add an event at the end of the code executed when you press the button
you mentioned. The code will be a single line that will cause the
recordsoruce of the combo to refresh.
If your combo's name is 'cboWhatever', then the code you add will be
Me.cboWhatever.Requery

Bob
 
Immediately after you add the new values to the table, requery the combo box.

Me.MyCombo.Requery

If this does not fix the problem, you will also have to requery the form.
 
Add an event at the end of the code executed when you press the button
you mentioned. The code will be a single line that will cause the
recordsoruce of the combo to refresh.
If your combo's name is 'cboWhatever', then the code you add will be
Me.cboWhatever.Reuery

Bob

OOPS X2, spelling error:
Me.cboWhatever.Requery
 
Back
Top