Refresh a form when closing a second form

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.
 
N

Nikos Yannacopoulos

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
 
P

PizzaBoy

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.
 

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