Mismatch type error

dcjones

Dereck
Local time
Today, 16:45
Joined
Mar 10, 2004
Messages
108
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
 
Possibly...?

Type mismatches are usually from this kind of thing...

stLinkCriteria = "[job_no]=" & Me![job_no]

Check that your Job_no field is an integer and that your Me![job_no] (the control) has a datasource which is also the same type - 'integer'.

HTH
Paul
 
Hi Paul.

Well spotted, thanks you were right.

Many tahnks again.

Kind regards
 

Users who are viewing this thread

Back
Top Bottom