DLookup in a Query (1 Viewer)

ListO

Señor Member
Local time
Today, 03:05
Joined
Feb 2, 2000
Messages
162
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

Super Moderator
Staff member
Local time
Yesterday, 22:05
Joined
Feb 19, 2002
Messages
43,392
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.
 

Users who are viewing this thread

Top Bottom