Results 1 to 4 of 4

Thread: Need to pass one variable to another form, but it's not passing the value.
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    Board Regular TAPS_MikeDion's Avatar
    Join Date
    Aug 2009
    Location
    Massachusetts
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Need to pass one variable to another form, but it's not passing the value.

    Hi everybody,

    Even after looking over examples found on the forum I still can't seem to get this super simple thing to work. I'm obviously missing something small.

    I have a main userform that has a "GET CLIENT INFO" button which opens a small userform displaying the client information, but I need the main userform to pass the variable ClientNum to the second form.

    This is the code in the first form.

    Code:
    Public ClientNum As Long
    
    
    Private Sub ClientInfoButton_Click()
    
    
        ClientInformationForm.Show
    
    
    End Sub
    When the ClientInformationForm opens it doesn't pass the value of ClientNum.

    Please help. Thanks!
    Last edited by TAPS_MikeDion; Sep 19th, 2019 at 10:20 PM.
    Mike Dion

  2. #2
    Board Regular
    Join Date
    Jul 2012
    Location
    Hampshire, UK
    Posts
    5,039
    Post Thanks / Like
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Need to pass one variable to another form, but it's not passing the value.

    Hi,
    Move your public variable

    Code:
    Public ClientNum As Long

    from your userform code page to a STANDARD module

    Dave

  3. #3
    Board Regular TAPS_MikeDion's Avatar
    Join Date
    Aug 2009
    Location
    Massachusetts
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Need to pass one variable to another form, but it's not passing the value.

    Knew it was something simple. Thanks Dave!
    Mike Dion

  4. #4
    Board Regular
    Join Date
    Jul 2012
    Location
    Hampshire, UK
    Posts
    5,039
    Post Thanks / Like
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)

    Default Re: Need to pass one variable to another form, but it's not passing the value.

    Quote Originally Posted by TAPS_MikeDion View Post
    Knew it was something simple. Thanks Dave!
    Most welcome


    Dave

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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