A
Andy G
I have a form that contains a subform that acts as a navigation/search bar
for student info. On this same form I have a tab control; on one of the
pages of the tab control I have a form with student data. I would like to
click on a student record in the navigation/search in the subform and have
the form within the tab control go to the specific record displaying the
detailed student data. My problem is that I can't seem to find the form on
the tab control through my code in the navigation/search subform.
Thanks for the help.
Private Sub txtName_Click()
'Go to specific record
Dim stLinkCriteria As String
Dim frm As Form, rs As Recordset
Set frm = Forms("frmScholarQuick") 'This is where it is failing, it
can't find this form. This is the form I need to display the detailed
'student data
MsgBox frm.Name
Set rs = frm.RecordsetClone
stLinkCriteria = "[ScholarID]=" & ScholarID
rs.FindFirst stLinkCriteria
If rs.NoMatch Then
MsgBox "No match exists."
Else
frm.Bookmark = rs.Bookmark
End If
Set rs = Nothing
rs.Close
End Sub
for student info. On this same form I have a tab control; on one of the
pages of the tab control I have a form with student data. I would like to
click on a student record in the navigation/search in the subform and have
the form within the tab control go to the specific record displaying the
detailed student data. My problem is that I can't seem to find the form on
the tab control through my code in the navigation/search subform.
Thanks for the help.
Private Sub txtName_Click()
'Go to specific record
Dim stLinkCriteria As String
Dim frm As Form, rs As Recordset
Set frm = Forms("frmScholarQuick") 'This is where it is failing, it
can't find this form. This is the form I need to display the detailed
'student data
MsgBox frm.Name
Set rs = frm.RecordsetClone
stLinkCriteria = "[ScholarID]=" & ScholarID
rs.FindFirst stLinkCriteria
If rs.NoMatch Then
MsgBox "No match exists."
Else
frm.Bookmark = rs.Bookmark
End If
Set rs = Nothing
rs.Close
End Sub