Error 91 following FindFirst

K

Ken

The following code works fine:

rec6.FindFirst "CustomerID = " & rec4("PAT_ACCT")

However, when I add the second criteria, I receive an error 91: Object
variable or With object variable not set:

rec6.FindFirst "CustomerID = " & rec4("PAT_ACCT") & " AND Rank = 1"

Any ideas? Thanks.
 
S

SteveS

Since this works

rec6.FindFirst "CustomerID = " & rec4("PAT_ACCT")

did you try using

rec6.FindFirst "Rank = 1" ??

If there is an error on the "Rank = 1" line, is there a field named "Rank"
in the recordset "rec6"?

Does the error happen if you use a different field instead of "Rank":

rec6.FindFirst "CustomerID = " & rec4("PAT_ACCT") & " AND OtherField = 1"

(replacing "OtherField = 1" with the field name and a suitable value)?


If there is still an error, please post the SQL of the recordset "rec6".


HTH
 
Top