How to put Query Calc Field into Form ?



Hmmm... I've got a calculated field in my query (named qryItemsToProducts)
like this...

Total: [Unit Price]*[Qty]

and it works...

But when I use Expression Builder to put it in a field on a form...

Form Properties: (Data Tab) - Control Source... set to...

=qryItemsToProducts![Unit Price]

The form displays #Name?

The underlying query gets data from my Items and Products tables.

Thanks for any help on how to fix this.

[MVP] S.Clark

If the field is contained in the Recordsource of the form, then just select
the field name in the ControlSource property.

If not, do something like:
=Dlookup("Total","qryItemsToProducts","ProductID=" & txtProductID)

Where txtProductID is a textbox on your form that holds the ProductID

Douglas J. Steele

The fact that you've put Total: in front of the calculation makes that the
name of the field. (Had you not put that, Access would have filled in Exprn,
where n is a number)

Assuming your form is bound to that query, the control source for your text
box should simply be Total.

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