I have a button on one form that when clicked is supposed to open another form. The form its supposed to open is based on a table with a composite key. Is it possible to get this bit of code to open the form based on 2 fields values? The wizard allows you one choice and as I know nothing abot VBA I need help.
Private Sub OpenBtn_Click()
On Error GoTo Err_OpenBtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Attended_Classes_And_Students"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenBtn_Click:
Exit Sub
Err_OpenBtn_Click:
MsgBox Err.Description
Resume Exit_OpenBtn_Click
End Sub
Private Sub OpenBtn_Click()
On Error GoTo Err_OpenBtn_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "Attended_Classes_And_Students"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_OpenBtn_Click:
Exit Sub
Err_OpenBtn_Click:
MsgBox Err.Description
Resume Exit_OpenBtn_Click
End Sub