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

Getting back to a subform from a report

Status
Not open for further replies.

markvan

Technical User
Sep 12, 2001
37
AU
This is my code:
Private Sub Report_Close()
On Error GoTo Err_Command198_Click

Dim stLinkCriteria As String
Dim mainNav As String

mainNav = "frm_NAV"

stLinkCriteria = "[ReportID]=" & Me![ReportID]
DoCmd.OpenForm mainNav, acNormal, , stLinkCriteria, acFormEdit, acWindowNormal


Exit_Command198_Click:
Exit Sub

Err_Command198_Click:
MsgBox Err.Description
Resume Exit_Command198_Click
End Sub

The problem is is that the reportID I'm trying to get to is on subform frm_studentrpt that is on page index 6 of the frm_NAV.
How do I address it to that in the coding?
Any help would be greatly appreciated.
Mark Van
EZ-PC Help
 

IF you have names the subform Control with the same name as the subForm itself then it is:-

Me!frm_studentrpt.Form!reportId

ELSE
replace frm_studentrpt with the name of the control that holds the subform.


G LS
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top