Capturing the return value of a query.

S

Steve S.

I have a query that returns only one value depending on a
persons age: ie returns 3 if the person is between 8 and
11 or returns 5 is between 15 and 19. the problem is the
only way I can the the value to display on a form is by
using a list box with the underlying query. Is there a
way to run the query in a macro and capture (setvalue??)
the returned value into another form?

Steve
 
B

Bas Cost Budde

Steve said:
I have a query that returns only one value depending on a
persons age: ie returns 3 if the person is between 8 and
11 or returns 5 is between 15 and 19. the problem is the
only way I can the the value to display on a form is by
using a list box with the underlying query. Is there a
way to run the query in a macro and capture (setvalue??)
the returned value into another form?

You can set the controlsource of a textbox to

=DLookup("firstfieldname","yourqueryname")
 
G

Guest

Thanks very much for the tip. I have read about DLookUP
but never used it. It is exactly what I needed. Thanks
again

Steve
 

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

Top