referring to a public Variable in a control or Query

G

Guest

Is it possible to refer to a public variable declared at module level in a
query and in a control (both report and form).
 
R

RoyVidar

jalewis999 wrote in message
Is it possible to refer to a public variable declared at module level
in a query and in a control (both report and form).

Not directly, but through a public function residing also in a standard
module.

public function GetMyVariable() as <your data type>
GetMyVariable = g_MyPublicVariable
end function

Then refer to that function both in the query and report. Note again,
that the function must reside in a standard module, not a forms/reports
module.
 
W

Wolfgang Kais

Hello "jalewis999".

jalewis999 said:
Is it possible to refer to a public variable declared at module
level in a query and in a control (both report and form).

No. You will have to create a function in a publi module that returns
the value stored in the variable and use this function in your query
or control.
 
G

Guest

Thanks problem solved


RoyVidar said:
jalewis999 wrote in message


Not directly, but through a public function residing also in a standard
module.

public function GetMyVariable() as <your data type>
GetMyVariable = g_MyPublicVariable
end function

Then refer to that function both in the query and report. Note again,
that the function must reside in a standard module, not a forms/reports
module.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top