Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

referring to a public Variable in a control or Query

Discussion in 'Information Technology' started by jalewis999, Jul 28, 2006.

  1. jalewis999

    jalewis999
    Expand Collapse
    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).
     
  2. Loading...


  3. Wolfgang Kais

    Wolfgang Kais
    Expand Collapse
    Guest

    Hello "jalewis999".

    "jalewis999" wrote:
    > 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.

    --
    Regards,
    Wolfgang
     
  4. RoyVidar

    RoyVidar
    Expand Collapse
    Guest

    jalewis999 wrote in message
    <F3089DDC-4DE0-43A1-AC36-07A286C8DD8A@microsoft.com> :
    > 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.

    --
    Roy-Vidar
     
  5. jalewis999

    jalewis999
    Expand Collapse
    Guest

    Thanks problem solved


    "RoyVidar" wrote:

    > jalewis999 wrote in message
    > <F3089DDC-4DE0-43A1-AC36-07A286C8DD8A@microsoft.com> :
    > > 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.
    >
    > --
    > Roy-Vidar
    >
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page