Refresh a form when closing a second form

  • Thread starter Thread starter PizzaBoy
  • Start date Start date
P

PizzaBoy

Hello,

I have a form which allows users to input vendor information in the
underlying table. The [vendor name] is a drop down list which is linked to
tables![vendor] which does not allow edits or additions. I have a button on
the form which allows a user to open a second form to add a new vendor name
to the [vendor] table without editing any existing data. After the user
closed the "add a vendor form" I want a way to refresh or requery the
existing vendor information form so it will then include the new vendor name
in the [vendor name] drop down list. Currently the only way the data will
refresh in the [vendor name list is to close the main form and reopen it.

Thank you for any help.
 
Assuming your first form is named MyForm1 and the vombo on it is called
MyCombo1, put the following line of code in the second form's On Close
event:

Forms![MyForm1]![MyCombo1].Requery

Of course, you'll use the actual form and combo names instead!

HTH,
Nikos
 
Thank you for the information. I placed the requery command in the "onclose"
event in the "add vendor" form, but when I close the form (using a command
button) it did not requery the drop down list box to include the just added
vendor name. Any additional ideas.

Thank you.

Nikos Yannacopoulos said:
Assuming your first form is named MyForm1 and the vombo on it is called
MyCombo1, put the following line of code in the second form's On Close
event:

Forms![MyForm1]![MyCombo1].Requery

Of course, you'll use the actual form and combo names instead!

HTH,
Nikos


Hello,

I have a form which allows users to input vendor information in the
underlying table. The [vendor name] is a drop down list which is linked
to tables![vendor] which does not allow edits or additions. I have a
button on the form which allows a user to open a second form to add a new
vendor name to the [vendor] table without editing any existing data.
After the user closed the "add a vendor form" I want a way to refresh or
requery the existing vendor information form so it will then include the
new vendor name in the [vendor name] drop down list. Currently the only
way the data will refresh in the [vendor name list is to close the main
form and reopen it.

Thank you for any help.
 
Back
Top