string problem in a recordset.FindNext

Z

Zachariah

stUNKLookup is "3" and I'm looking in a 2 field table for
the next record where Field1 is "1401.001" and Field2 is
stUNKLookup. Is this possible or do I have to break the
second condition out into a separate if statement?

Current code:

stUNKLookup = rsEDISample!Field2
..
..
..
rsEDISample.FindNext "Field1 = '1401.001' AND Field2 =
stUNKLookup"

Currently I get an error:
"The Microsoft Jet database engine does not
recognized 'stUNKLookup' as a valid field name or
expression"
 
Z

Zachariah

I ended up throwing the whole line into the stUNKLookup
string a la

stUNKLookup = "Field1 = '1401.001' AND Field2 = '" &
stUNKLookup & "'"

and then

rsEDISample.FindNext stUNKLookup
 

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