| re: Dsum Function. What is wrong with my expression?
Hi. Sorry, but you can't achieve this using DSum the way you are trying to do. DSum sums fields in the specified table or query. It does not sum unbound textboxes - that is not its purpose. The help file data available off-line and on-line as part of Office Pro will guide you how to use DSum.
Your table/query reference is also in error - you are supplying the name of your form in place of a valid table or query.
And finally you are also supplying a similarly incorrect form control reference in the Where clause.
The #Error you are seeing results from Access not being able to recognise any of the things you tell it to do - the field to be summed, the table you want to sum within, and the Where clause are all incorrect.
As you have criteria involved you will either need to use DSum correctly, specifying the relevant field from the underlying table you want to sum and supplying a suitable where clause to restrict your results, or you will need to reconsider entirely the values you are including in your underlying query so that the sum of the relevant fields can be done in the report itself.
-Stewart
|