Data Type Mismatch?

E

Eddy

I am using the following code to find a record in a recordset.
Set db = CurrentDb
Set rs = db.OpenRecordset("qry1", dbOpenDynaset)

rs.FindFirst "SeqNoDO = '" & intSeqNo & "'"

I Dimmed the variable intSeqNo as Byte. The SeqNoDo field in the qry is
pulled from a table where it's data type is Number. Every time I run the
code I get a Data Type Mismatch in Criteria Expression. In the debug
window both SeqNoDo and the variable intSeqNo are equal to 1.

Obviously I am missing something. Help. Thanks.
 
W

Wayne Morgan

rs.FindFirst "SeqNoDO = " & intSeqNo

You don't need the extra quotes, it is a number not a string.
 

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