Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    public var in report (Access 2003)

    In an Access report, I can refer to a textbox used in an open form, such as
    =Forms![frmModifyInvoice]![txtAcctBal]

    and print out the amount stored in txtAcctBal

    I am wondering if I can store the amt in a public variable and then have this report refer to this var and print it out
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: public var in report (Access 2003)

    No, you cannot refer directly to a variableon a form or report, but you can create a function for it, for example:

    In a standard module:

    Public curAcctBal As Currency

    Public Function GetAcctBal() As Currency
    GetAcctBal = curAcctBal
    End Function

    In the Control Source of a text box on a form or report:

    =GetAcctBal()

    You must, of course, set the value of curAcctBal somewhere.

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    283
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: public var in report (Access 2003)

    Thanks Hans.

    It works GREAT!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •