Results 1 to 2 of 2
  1. #1
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    New England (Connecticut)
    Posts
    200
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Public function (Office 2003)

    Hi all,

    I am calling a public function called "TARbtnLabel" which assigns a caption to a button. In this Public function I have a variable called "vFMRString" which captures data from various fields and stores them as a string, then assigns that string as the caption on the button. I want to be able to use that variable elsewhere in my program without recreating a lot of code. Is it possible to use that variable since it is contained inside of a public function?

    thanks
    Kevin
    Kevin

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

    Re: Public function (Office 2003)

    If you want to use the variable outside the function, you should declare it at the top of the module as a public variable.

    Public vFMRString

    or

    Public vFMRString As String

    Remove the declaration of vFMRString from your function (this is important)!

Posting Permissions

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