Welcome to SPN

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

Sign Up Now!

report to reference a variable

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

  1. Pritesh_karma

    Pritesh_karma
    Expand Collapse
    Guest

    Hi.

    I have a report total sales of some firms.
    I need, in the report, to be able to access a single sales of a firm,
    which is stored in a variable in my vb code.
    How do i put the variable in the report, in my textbox( control source)

    thanks
     
  2. Loading...

    Similar Threads Forum Date
    UK British Sikh Report-2016 Breaking News Mar 24, 2016
    1984 The Story I Did Not Report In ’84 History of Sikhism Jun 28, 2015
    Opinion Top Green Beret Officer Forced to Resign Over Affair With WaPo Reporter Breaking News Jun 26, 2014
    United Sikhs New Report Shows Increasing Hate Attacks on Sikhs Sikh Organisations May 21, 2014
    Legal ACLU reports: Judge orders Sikh man, "Remove that rag, or Go to Jail! Breaking News Sep 27, 2013

  3. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Create a function that returns the value of the variable, and use the
    function in your report.

    (Note: it has to be a public function in a module, not a class or module
    associated with a form)

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Pritesh_karma" <pritesh01@gmail.com> wrote in message
    news:1152183366.151869.36160@a14g2000cwb.googlegroups.com...
    > Hi.
    >
    > I have a report total sales of some firms.
    > I need, in the report, to be able to access a single sales of a firm,
    > which is stored in a variable in my vb code.
    > How do i put the variable in the report, in my textbox( control source)
    >
    > thanks
    >
     
  4. Pritesh_karma

    Pritesh_karma
    Expand Collapse
    Guest

    thanks douglas...
    how do i do this...
    Im quite new to programming....


    Douglas J Steele wrote:
    > Create a function that returns the value of the variable, and use the
    > function in your report.
    >
    > (Note: it has to be a public function in a module, not a class or module
    > associated with a form)
    >
    > --
    > Doug Steele, Microsoft Access MVP
    > http://I.Am/DougSteele
    > (no e-mails, please!)
    >
    >
    > "Pritesh_karma" <pritesh01@gmail.com> wrote in message
    > news:1152183366.151869.36160@a14g2000cwb.googlegroups.com...
    > > Hi.
    > >
    > > I have a report total sales of some firms.
    > > I need, in the report, to be able to access a single sales of a firm,
    > > which is stored in a variable in my vb code.
    > > How do i put the variable in the report, in my textbox( control source)
    > >
    > > thanks
    > >
     
  5. Douglas J Steele

    Douglas J Steele
    Expand Collapse
    Guest

    Create a new module.

    Inside the module, type something like:


    Public MyVariable As Long

    Public Function MyFunction() As Long
    MyFunction = MyVariable
    End Function


    (use the appropriate names for MyVariable and MyFunction. If your existing
    variable is a different data type than Long, make sure you change the
    declaration of the function as well)

    Save the module, making sure you don't name the module the same as the
    function.

    Wherever you need the value of MyVariable, use MyFunction instead.

    --
    Doug Steele, Microsoft Access MVP
    http://I.Am/DougSteele
    (no e-mails, please!)


    "Pritesh_karma" <pritesh01@gmail.com> wrote in message
    news:1152191508.877545.78150@a14g2000cwb.googlegroups.com...
    > thanks douglas...
    > how do i do this...
    > Im quite new to programming....
    >
    >
    > Douglas J Steele wrote:
    > > Create a function that returns the value of the variable, and use the
    > > function in your report.
    > >
    > > (Note: it has to be a public function in a module, not a class or module
    > > associated with a form)
    > >
    > > --
    > > Doug Steele, Microsoft Access MVP
    > > http://I.Am/DougSteele
    > > (no e-mails, please!)
    > >
    > >
    > > "Pritesh_karma" <pritesh01@gmail.com> wrote in message
    > > news:1152183366.151869.36160@a14g2000cwb.googlegroups.com...
    > > > Hi.
    > > >
    > > > I have a report total sales of some firms.
    > > > I need, in the report, to be able to access a single sales of a firm,
    > > > which is stored in a variable in my vb code.
    > > > How do i put the variable in the report, in my textbox( control

    source)
    > > >
    > > > thanks
    > > >

    >
     

Share This Page