View Full Version : DLookup in a Query


ListO
07-22-2001, 11:59 AM
Hi, All...

What is the protocol for returning a field of a particular record number in a query?

I would like to pull up the field like this:

For X = 1 to DCount(queryname)

myString = DLookup([fieldname],queryname, "recordnumber =" X)

'mess around with that data for a bit

Next X

I just can't figure out how to reference it if the criteria is simply the record number in that query.

Thanks so much.

-Curt

Pat Hartman
07-22-2001, 03:37 PM
If what you are trying to do is to process a recordset in code, DLookup() is not a good method for a lot of reasons. Look up movenext in help or in this formum's archives for sample code that loops through a recordset.

FYI, relational tables do not have permanent "record numbers" as ISAM files do.