Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to refresh form that has subforms in it

Status
Not open for further replies.

aquinox

Programmer
Jul 2, 2007
38
AU
Hi,

I have a problem with refreshing a form which has two subforms in it.

For example, Form AForm has subform1 and subform2. In the form, there is a button called "Add New". When clicking the button, another form BForm will pop up allowing user to enter relevant fields. What i'd like to happen is as soon as the user click close button on BForm. I want to see the new record automatically appears on the subform1. I think i can do this by refreshing the AForm but to no avail.

I used the following code in the event of Form_Unload in the form BForm

[Forms]![AForm].refresh

That didn't work. Then tried to refresh the subform1. It didn't refresh either.

Any ideas?

Thank you in advance

 
Perhaps this ?
[Forms]![AForm].Requery

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thank you, PHV

It works now. I don't know what i did before. i certainly did try to use requery but it didn't work back then.

Anyway, all matters is that it works now.

Thank you for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top