Re-read Post #10! You're still using
=Sum([ExtendedPrice])
and you cannot do this with an Aggregate Function against a calculated field! You have to use Sum() against the calculation, itself:
=Sum([Qty]*[UnitPrice])
Linq ;0)>
Re-read Post #10! You're still using
=Sum([ExtendedPrice])
and you cannot do this with an Aggregate Function against a calculated field! You have to use Sum() against the calculation, itself:
=Sum([Qty]*[UnitPrice])
Linq ;0)>
Maybe more accurate to say cannot reference a textbox. Aggregrate expression can only reference fields in the form RecordSource. If you did the calc in query then that would create a field in the form RecordSource that could be referenced.
So as Linq describes:
=Sum([Qty] * [UnitPrice])
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
First make sure your Qty text box isn't named Qty same with Unit price. If the control and field have the same name it will error.
Second your order subtotal doesn't need the .Form in it.
Error will occur if textbox has same name as bound field and expression in that textbox references the name.
For instance, field and textbox have same name Qty.
Expression in that textbox ControlSource: =Nz([Qty],0).
This is circular reference.
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.
It would be a good idea to get in the habit of renaming your controls. Most programmer use a similar naming convention of using a prefix of the control type with the field name (like txtName to represent a textbok the holds a name field data) doesn't matter what naming convention you use but you should choose one.
For missinglinq. If you do the calculation in a query and then use the alias from that query you are using a field for your domain aggregate function. Works perfectly well and is easier than typing out the the entire calculation whenever you need it.
Check your control names and edit out the .Form I mentioned earlier and you should be fine and do the calculation as missinglinq describes or put it in the query.