Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

FindNext error

Status
Not open for further replies.

kronar

Programmer
Jan 12, 2003
60
0
0
US
I am triing to find if a record exists in the table. Am using FindNext but keep getting "Run Time Error 3464 - Data Type Mismatch in criteria expression"

on the line
"JBrec.FindNext "JB_JobBidNo = " & strJobNo"
I load string strJobNo with EnterJobNo
"strJobNo = EnterJobNo"
also tried 'strJobNo = EnterJobNo.Value"

both get same error, help - thanks
 
It seems likely that JB_JobBidNo is a text field. Try:

JBrec.FindNext "JB_JobBidNo = '" & strJobNo & "'
 
Hi kronar
or you could try to open the form with

docmd.openform "formname",,,"uniqueIDfield = '" & [recordnumber]

Substitue the form, fields and recordnumber criteria as appropriate.

Or using a query, put the following in the criteria of the field you wish to search. and base the forms record source on this query.

like "*" & [AnAppropriatemessage] & "*"

regards
Ian Mayor





Ian Mayor (UK)
Program Error
Programming is 1% coding, 50% error checking and 49% sweat as your application bombs out in front of the client.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top