Variable in a report

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

Guest

I set a public variable in a form. I then try to use it in a header of a
report. But when I do the report, a box comes up and asks for a value to be
inputted for that variable.
I set the variable in the 'on open' of the report and do a breakpoint to
make sure it is set -- it is. But yet why is it asking me?

Mike J
 
mjj4golf said:
I set a public variable in a form. I then try to use it in a header
of a report. But when I do the report, a box comes up and asks for a
value to be inputted for that variable.
I set the variable in the 'on open' of the report and do a
breakpoint to make sure it is set -- it is. But yet why is it asking
me?

Mike J

Exactly how are you trying to "use it in a header"?

Variables can only be used directly in VBA code. You cannot use them in a
ControlSource expression or in a query unless you build a custom function that
returns the value for you.
 
Back
Top