+ Reply to Thread
Results 1 to 2 of 2

Pass combo box value to string variable in module

  1. #1
    magix
    Guest

    Pass combo box value to string variable in module

    Hi,

    In the OK button click event, how can I pass back the selected
    "me.Combobox1.Value" to my module ?
    The combo box is in userform.

    Usually in my module, I define a string variable.
    e.g
    sub Test()
    Dim fname as string
    ...
    ...
    end sub

    So how can pass the combox value to variable fname in my Test Module
    directly?
    Note: I don't want to pass the combox value to cell, and then use fname to
    read from cell.

    Thanks.

    Regards, magix



  2. #2
    Dave Peterson
    Guest

    Re: Pass combo box value to string variable in module

    Declare Fname as Public at the top of your module, but inside that General
    module.

    Option Explicit
    Public fname as string
    sub test()
    ....
    end sub

    is one way.

    magix wrote:
    >
    > Hi,
    >
    > In the OK button click event, how can I pass back the selected
    > "me.Combobox1.Value" to my module ?
    > The combo box is in userform.
    >
    > Usually in my module, I define a string variable.
    > e.g
    > sub Test()
    > Dim fname as string
    > ...
    > ...
    > end sub
    >
    > So how can pass the combox value to variable fname in my Test Module
    > directly?
    > Note: I don't want to pass the combox value to cell, and then use fname to
    > read from cell.
    >
    > Thanks.
    >
    > Regards, magix


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1