DAO Recordset FindFirst HELP

  • Thread starter Thread starter Brandon Johnson
  • Start date Start date
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
 
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).
 
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).
 
Back
Top