Error Message

  • Thread starter jjsaw5 via AccessMonster.com
  • 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
 
D

Douglas J. Steele

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)
 
J

jjsaw5 via AccessMonster.com

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
 
J

jjsaw5 via AccessMonster.com

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top