Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Printing module variable (Access 2000 Sr-1)

    Hi,
    If I declare and store a string/numeric into a variable within a module
    how do I recall and display it on a report.
    eg.
    For nKounter = 1 To 5
    If nKounter = 4 Then
    endif
    next nKounter

    Ho do I display nKounter on a report ?

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

    Re: Printing module variable (Access 2000 Sr-1)

    You have to create a small function that returns the value of the variable. In a module:

    <img src=/w3timages/blueline.gif width=33% height=2>

    Public nKounter As Long

    Public Function GetKounter() As Long
    GetKounter = nKounter
    End Function

    <img src=/w3timages/blueline.gif width=33% height=2>

    Use it as follows in the control source of a text box on a form or report:

    =GetKounter()

  3. #3
    2 Star Lounger
    Join Date
    Feb 2003
    Location
    Melbourne, Victoria, Australia
    Posts
    139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Printing module variable (Access 2000 Sr-1)

    Thanks Hans.
    Works like a treat!

    Regards
    Michael

Posting Permissions

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