Hi All,
I have the following code behind a command button on a form. When the button is clicked it calls a query "qrtJobBookout" and should display all the record that match the job number in form "frmJobBook". But it displays a error of "type mismatch".
form name = frmJobBook, Button name = Command58
Private Sub Command58_Click()
If (Combo54) = "No" Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "qryJobBookout"
stLinkCriteria = "[job_no]=" & Me![job_no]
DoCmd.OpenQuery stDocName, , stLinkCriteria
Else
Dim stDocName2 As String
Dim stLinkCriteria2 As String
stDocName2 = "frmDifferentShippingAdd"
DoCmd.OpenForm stDocName2, , , stLinkCriteria2, acFormAdd
End If
End Sub
Can anyone see what is causing this error.
Kind regards
Dereck
I have the following code behind a command button on a form. When the button is clicked it calls a query "qrtJobBookout" and should display all the record that match the job number in form "frmJobBook". But it displays a error of "type mismatch".
form name = frmJobBook, Button name = Command58
Private Sub Command58_Click()
If (Combo54) = "No" Then
Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "qryJobBookout"
stLinkCriteria = "[job_no]=" & Me![job_no]
DoCmd.OpenQuery stDocName, , stLinkCriteria
Else
Dim stDocName2 As String
Dim stLinkCriteria2 As String
stDocName2 = "frmDifferentShippingAdd"
DoCmd.OpenForm stDocName2, , , stLinkCriteria2, acFormAdd
End If
End Sub
Can anyone see what is causing this error.
Kind regards
Dereck