report using global variable?

  • Thread starter Thread starter Steven Greenberg
  • Start date Start date
S

Steven Greenberg

Greetings all,

Is there a way for a report to access a public global variable defined in a
module? If so, what is the syntax for it as I can't seem to ever get it to
work. I have resorted to storing the variable on a form but there have been
times where a global variable would be better. Any help would be
appreciated.
Thanks
Steve
 
You can create a small function in a standard module that returns the global
variable.

Public Function GetMyVariable() as String
GetMyVariable = gstrMyVariable
End Function

Then set a control source to:
=GetMyVariable()
 
You can create a small function in a standard module that returns the
global variable.

Public Function GetMyVariable() as String
GetMyVariable = gstrMyVariable
End Function

Then set a control source to:
=GetMyVariable()

Darn it! Why didn't I think of that? I must admit that is a great way of
doing it. I will try it out next time I need it.
Thanks to you and the group yet again.
Steve
 
You can create a small function in a standard module that returns the
global variable.

Public Function GetMyVariable() as String
GetMyVariable = gstrMyVariable
End Function

Then set a control source to:
=GetMyVariable()

Thanks Duane,
someone came up with the same method. I can't believe it is so easy.
Steve
 
Back
Top