Hi,
I am getting a type mismatch error on the following code. My objective is to open a detail form from a header form passing two criteria through - LoginName & db. Any help appreciated.
Private Sub ViewDetail_Click()
On Error GoTo Err_ViewDetail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_UserDetail"
stLinkCriteria = "[LoginName]=" & "'" & Me![LoginName] & "'" And "[DB]=" & "'" & Me![DB] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ViewDetail_Click:
Exit Sub
Err_ViewDetail_Click:
MsgBox Err.Description
Resume Exit_ViewDetail_Click
End Sub
I am getting a type mismatch error on the following code. My objective is to open a detail form from a header form passing two criteria through - LoginName & db. Any help appreciated.
Private Sub ViewDetail_Click()
On Error GoTo Err_ViewDetail_Click
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "frm_UserDetail"
stLinkCriteria = "[LoginName]=" & "'" & Me![LoginName] & "'" And "[DB]=" & "'" & Me![DB] & "'"
DoCmd.OpenForm stDocName, , , stLinkCriteria
Exit_ViewDetail_Click:
Exit Sub
Err_ViewDetail_Click:
MsgBox Err.Description
Resume Exit_ViewDetail_Click
End Sub