How do I use labels on formthat include a sum on a form into a rep

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

Guest

I have a label in a Form Footer which contains a total sum formula. Now I
want to use that total in a report. How do I get it there?
 
Stick an unbound control on the report and set it's control source to
=Forms!FormName!ControlNameInFormFooter
 
Is it a label or a textbox? If the form is open, the report should be able
to refer to the control on the form. If the form isn't open, you will need
to rerun the calculation in the report or pass the value to the report as
you open it.

To refer to a control on the form:
Forms!FormName!ControlName

This will get the Value property from the control, it you are using a label,
it doesn't have a value. Instead, you'll need to use the Caption property.

Forms!FormName!ControlName.Caption

To pass the value to the report you can use the OpenArgs argument of
DoCmd.OpenReport, depending on your version of Access, or you can use a
"global variable" to hold the value then refer to that variable in the
report.
 
Back
Top