Calculate Total from Query in Form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form 'Invoice' which has a query. The query is limited by criteria. I would like to calculate the sum total of 'LineTotal' field of the subquery in the form. I have used cod

=Sum([InvoiceSubform].Form!LineTotal

but it gives error. Please help

Secondly, this form does not print. It is blank in print preview even after showing data on screen. Please help

TIA.
 
Hi JB,

JB said:
I have a form 'Invoice' which has a query. The query is limited by
criteria. I would like to calculate the sum total of 'LineTotal' field of
the subquery in the form. I have used code
=Sum([InvoiceSubform].Form!LineTotal)

but it gives error. Please help.

You cannot use SUM() to sum fields on a form. It has to be done on the
underlying data. If the field you want is called LineTotal then the correct
syntax is =Sum([LineTotal]). Do not name a control on the form to LineTotal
or things will get confusing.
Secondly, this form does not print. It is blank in print preview even
after showing data on screen. Please help.

You really shouldn't be printing forms. They are just a method to view the
info on screen. Printing a form will only give you the layout, like you are
finding out. A form only has data when it is being viewed on the screen.
When you try to print, this creates an image of the form to be printed
without data. If you want to print, recreate the form as a report and print
that.

Good luck.
 
Back
Top