Capturing the return value of a query.

  • Thread starter Thread starter Steve S.
  • Start date Start date
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
 
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")
 
Thanks very much for the tip. I have read about DLookUP
but never used it. It is exactly what I needed. Thanks
again

Steve
 
Back
Top