Query a field with more than one record?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Currently I use a Dlookup function to give me a field from a table. How do I
get say, the second record of that field? When I use the Dlookup in the or:
slot below the field, it still only queries based on the first record.

DLookUp("[NextCount]","[CYQueryTbl]","[NextCount]>0") (In Criteria: line)
DLookUp("[NextCount]","[CYQueryTbl]","[NextCount]>0") (In or: line)

Still only queries on first record. Is this even possible?
 
I would do it with VBA.

dim strFirst as string
dim strSecond as string

strFirst = nz(dlookup(...),"")
if len(strFirst) > 0 then
strSecond = nz(dlookup(.., "Field <> " & strFirst),"")
end if
 

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

Back
Top