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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh Subform From Button on Main Form

Status
Not open for further replies.

MagnusFox

IS-IT--Management
Jan 12, 2001
51
US
I want to click a button on the main form and refresh the data that is entered in suform. The Focus is still set in the subform, and I want to click the button on the main form to update the subform.

I cannot seem to get my code correct on the button. I have a button on the main form with the following code on click:
[Subform].Forms![Main Form].Refresh (does not compile)
-OR-
Subform.Form.Refresh (does not seem to do anything)
This is not correct, but I do not know what to do to correct it.

I can change a value in the subform, then choose "Records/Refresh" from the tool bar to get the results I want, but not from the button on the main form.

Many thanks in advance,
Ignorance

 
Remember, the button being pressed is on the main form. Me.Refresh only refreshes the main form. I need to refresh the subform.

 

DoCmd.GoToControl "subformname"
me.refresh

or
DoCmd.GoToControl "subformname"
me.requery

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top