My 1st form had 2 fields, class and year. I wish to link it to another form through these two fields. I inserted a button which the wizard help me display the next form using the class field. Is there any way that I could change the code which could link to the next form through both the class and year fields?
The code generated by the wizard is:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Student"
stLinkCriteria = "[Year]=" & "'" & Me![SearchYear] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
Thank You very much!
The code generated by the wizard is:
Private Sub Command15_Click()
On Error GoTo Err_Command15_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Student"
stLinkCriteria = "[Year]=" & "'" & Me![SearchYear] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_Command15_Click:
Exit Sub
Err_Command15_Click:
MsgBox Err.Description
Resume Exit_Command15_Click
End Sub
Thank You very much!