public value in report

  • Thread starter Thread starter Jean-Paul
  • Start date Start date
J

Jean-Paul

Hi,
I have a module where I declare some public values.
I called it MP_Setup
Here I have some date variables: Start_datum

When I create a report and I want that value in the header I created an
entryfield and wrote in the property:

= MP_Setup.start_datum

Acces automatically changes this into

= [MP_Setup].[start_datum]

Which of course returns an error...

What am I doing wrong?
Thanks
 
You cannot read a variable directly.

Use a function to return the value:
Public Function ShowStartDatum()
ShowShartDatum = Start_datum
End Function
and set the Control Source to use the function:
=ShowStartDatum()

Either that, or assign it to something other than a variable, e.g. a
(hidden) text box on a form, or a TempVar (Access 2007 only.)
 
If you might need it available for other forms/reports as well, it would be
best in a standard module (one created through the Modules tab of the
Database window, or the Insert menu in the code window.)
 
Back
Top