Good Day all,
Can anyone guide me how to sum a calculated field in MSAccess VBA?
Good Day all,
Can anyone guide me how to sum a calculated field in MSAccess VBA?
This calculated field is expression in table or query or textbox?
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.
In a textbox
Assuming it's a continuous form in the form footer or header use
=Sum(YourTextBoxControl)
DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
Please use the star below the post to say thanks if we have helped !
↓↓ It's down here ↓↓
Aggregate functions cannot reference controls, only fields. So if the textbox has expression like: =Quantity * Price, the aggregate calc would have to repeat the expression: =Sum(Quantity * Price).
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.
Thanks.But this is not working.
Here is my textbox entryThis gives the following message #Errorsum([cost] * [Quan to Order]
Need = sign at beginning of expression and closing paren.
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.
Thanks. Everything is good.