Referring to a query in VB code

Courtman

Paranoid Android
Local time
Today, 16:49
Joined
Dec 8, 2001
Messages
34
Hi

I am trying to run a sequence of code that checks the results of a query when a form opens. I've called the sub Single_Validity(). Based on the results of the query the system will change the properties of a text box on the main form.

How do I refer to a query in my VB code? I've searched help, about 3 reference books and am now banging my head as I can't find anything....

What I would like the code to do is put the results of the query into three variables: PIChrs, P1hrs, and Landings. Then a series of If loops will check the data out.

Any help gratefully received.... thanks in advance!
 
You can use the Dlookup function to assign values to variables based on query data.

myVar = DLookup(expr, domain[, criteria])

This assigns a single value from the query (based on a certain criteria) to myVar.

See DLookup in VBHelp

You'll have to be more specific for more help
 

Users who are viewing this thread

Back
Top Bottom