Welcome to SPN

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

Sign Up Now!

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
    >
    >
    >
     

Share This Page