How to put Query Calc Field into Form ?

  • Thread starter Thread starter Will
  • Start date Start date
W

Will

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...
setting...

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.
 
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
 
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.
 
Back
Top