View Full Version : DoCmd.OpenQuery....run, and then display calc in textbox


JCross
05-07-2002, 10:59 AM
Hi. I'm sorry I've been posting and deleting but I'm trying to figure out just what my problem is before I ask for help....

I want to run a query on the close of a form, and take a calculated field from that query and display the number in a text box on a linked form.

So, on 'save' I have docmd.openquery "qryNoTax"
which produces a field "notax"
how do I USE this field from the query on my form?

Thank you!

Jennifer

RichMorrison
05-07-2002, 12:46 PM
Jennifer,

The general form is:
= DLookup("NoTax","qryNoTax")

You can enter that in the "ControlSource" property of a text box on a form(include the equal sign)

See Access Help for more details on DLookup.

RichM

JCross
05-08-2002, 07:33 AM
Thank you, RIch. I've used DLookup - I just didn't know I could use it for a query. Works perfectly!

Jennifer