Error Message

  • Thread starter Thread starter jjsaw5 via AccessMonster.com
  • Start date Start date
J

jjsaw5 via AccessMonster.com

I have a serach on a form that is preformed by a textbox with a search button
and the search was working fine and all of a sudden i am getting this error...


Runtim Error 3464
DataType mismatch in criteria expression


here is the code that prefroms my search....


Private Sub Command21_Click()
If IsNull(Text15) = False Then
Me.Recordset.FindFirst "z6=" & Text15
Me!Text15 = Null
If Me.Recordset.NoMatch Then
MsgBox "No record found", vbOKOnly + vbInformation, "Sorry"
Me!Text15 = Null
End If
End If
End Sub
 
What's the data type of z6? If it's text, you need quotes around the value:

Me.Recordset.FindFirst "z6=""" & Text15 & """"

(that's 3 double quotes in front, and 4 double quotes afterwards)
 
No its a numeric field, i apologize for not stating that earlier.
What's the data type of z6? If it's text, you need quotes around the value:

Me.Recordset.FindFirst "z6=""" & Text15 & """"

(that's 3 double quotes in front, and 4 double quotes afterwards)
I have a serach on a form that is preformed by a textbox with a search
button
[quoted text clipped - 16 lines]
End If
End Sub
 
Actually your solution solved my problem, after looking through the data,
there is text in Z6 which is supposed to be a numeric field. You solution
works!

Thanks much!
What's the data type of z6? If it's text, you need quotes around the value:

Me.Recordset.FindFirst "z6=""" & Text15 & """"

(that's 3 double quotes in front, and 4 double quotes afterwards)
I have a serach on a form that is preformed by a textbox with a search
button
[quoted text clipped - 16 lines]
End If
End Sub
 
Back
Top