Refresh a combo box

  • Thread starter Thread starter Nate via AccessMonster.com
  • Start date Start date
N

Nate via AccessMonster.com

Hello All

Does anyone know a way to automatically refresh one form after adding a
record to a second form without having to add a refresh button to the main
form?
I have a combo box with a list of vendors. I have it set up when a user
double clicks the combo box a form pops up to add another vendor. When I
close the vendor form after adding a new vendor, I am not able to see the
verdor I just added in the combo box. I would like to be able to refresh
my main form when I press the close button of my vendor form.
Is this possible or is there another way?

Please be specific, I am not much of a programmer.

Thanks for the help
Nate
 
Are you using a macro or VBA code to open the vendor form? I'm not familiar
with macros, so can't help you there. You can put a line of code in the
vendor form's close event to requery the combo box:
Forms!FirstFormName.ComboBoxName.Requery

or you can use the double-click event of the combo box to open the second
form in Dialog mode (which pauses the code until the form closes) and then
requery the combo box after the vendor form closes:
DoCmd.OpenForm "VendorFormName", , , , , acDialog
Me.ComboBoxName.Requery

Just change the form names and combo box name to match what's in your
database. Another option would be to set the combo box's "Limit to List"
property to True and use the "Not in List" event to open the vendor form,
etc.
 
Mark

Your second suggestion worked perfectly.

Thanks for the help
Nate
 
Back
Top