performing a lookup on a query

  • Thread starter Thread starter bigbore50
  • Start date Start date
B

bigbore50

is it possible to perform a lookup on a query

I want to do a look that counts from lets say 1 to 10

in this loop i want to look up

x=1
loop until x=10
lookup("auditor",qry_audits, where record = x)
auditor(x) = lookup value
x = x+1
end loop


I can't figure out the exact code

PLEASE HELP !!!

Thanks you very much
 
is it possible to perform a lookup on a query

I want to do a look that counts from lets say 1 to 10

in this loop i want to look up

x=1
loop until x=10
lookup("auditor",qry_audits, where record = x)
auditor(x) = lookup value
x = x+1
end loop


For x = 1 To 10
auditor(x)=DLookup("auditor","qry_audits","record= "& x)
Bext x
 
Well i used this code and it says Sub or Function not defined

and i did define them as

Dim auditor1 As String
Dim auditor2 As String
Dim auditor3 As String
For x = 1 To 3
auditor(x)=DLookup("auditor","qry_audits","record= "& x)
Next x

Is this the wrong way to do it?
 
Well i used this code and it says Sub or Function not defined

and i did define them as

Dim auditor1 As String
Dim auditor2 As String
Dim auditor3 As String


Is this the wrong way to do it?


You are correct, that is the wrong way ;-)

Your syntax implied an array, which was the right way:

Dim astrAuditor(1 To 3) As String

This entire operation may be the wrong way to deal with
whatever it is that you want to accomplish, but I can't tell
from what you've said so far.
 

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