DAO Recordset FindFirst HELP

B

Brandon Johnson

Im getting this very annoying error and cant figure it out for the life
of me. basically on the masternum.findfirst(criteria) line, it throws
an error that states... "Run-time error '3436' data type mismatch in
criteria expression" ive checked all my tables to make sure the data
types are correct and nothing is different. if ANYONE can help, it
would be great. thankyou.

Do Until upcnum.EOF
upc = upcnum!UPCCase
criteria = "[CustNbr] = '" & num & "' AND [UPCCase] = '" &
upc & "'"
masternum.FindFirst (criteria)
If masternum.NoMatch() Then
final.AddNew
final!num = num
final!case = UPCCase
final.Update
End If
upcnum.MoveNext
Loop
 
A

Allen Browne

If you open your table in design view, what data types are CustNbr and
UPCCase?

If number, lose the extra quotes:
criteria = "([CustNbr] = " & num & ") AND ([UPCCase] = upc & ")"

You may also be able to see what is wrong if you:
Debug.Print criteria
just before the FindFirst. When it fails, check what came out in the
Immediate Window (Ctrl+G).
 
A

Allen Browne

If you open your table in design view, what data types are CustNbr and
UPCCase?

If number, lose the extra quotes:
criteria = "([CustNbr] = " & num & ") AND ([UPCCase] = upc & ")"

You may also be able to see what is wrong if you:
Debug.Print criteria
just before the FindFirst. When it fails, check what came out in the
Immediate Window (Ctrl+G).
 

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

Similar Threads


Top