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

Refresh from subform 2

Status
Not open for further replies.

logopolis

Technical User
Oct 10, 2002
59
0
0
ES
Is it possible to refresh a form from an action in the subform, how do i change the code to refer to the form?

Current code is:

Private Sub Form_AfterUpdate()
On Error GoTo Err_Form_AfterUpdate


DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70

Exit_Course_ID_Exit:
Exit Sub

Err_Form_AfterUpdate:
MsgBox Err.Description
Resume Exit_Form_AfterUpdate

End Sub

Many thanks

John
 
You don't say where this code is located, but I'm assuming the subform. Some (possible) samples assuming it's within the subform:

Another form:
[tt]forms!frmYourFormName.Refresh[/tt]

Parent form from the subform:
[tt]Me.Parent.Refresh[/tt] 'or perhaps
[tt]Me.Parent.Form.Refresh[/tt]

I think it also might be possible to use your current code, but just set focus to the other form first.

Roy-Vidar
 
You can try something like this:
Forms![Name of main form].Requery (or .Refresh or .Recalc)

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top