Combobox not store data
Prep for a pre-employment Excel test with Job Test Prep
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: Combobox not store data

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Question:
    does the code below(txtCode is the name of my combobox, strRowSource is the address of the Data in a column) stores the data in the combobox???

    The code:

    With UserForm1.txtCode
    'Clear old ListBox RowSource
    .RowSource = vbNullString
    'Parse new one
    .RowSource = strRowSource4
    '.AddItem = strRowSource
    End With

    Because when I chack the value with
    msgbox userform1.txtCode.Value
    it returns nothing

    Can someone please help me out
    Thanks in advance

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Bogota, Colombia
    Posts
    11,959
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I guess that depends of WHEN you're calling the .Value of the Combobox.

    There's also a .Clear that clears everything out of the ComboBox.
    Regards,

    Juan Pablo González
    http://www.juanpg.com

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    67
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    In my module, I have a Main sub:
    Public Sub Main()
    SortAndRemoveDupes
    UserForm1.Show

    End Sub

    SortAndRemoveDupes is also in the same module which stores the data in the Combobox

    Then in my UserForm I have

    Private Sub SearchButton_Click()
    MainSearch
    Unload Me
    End Sub

    The code for MainSearh is in the module(not in userform). I uses the .Value in the MainSearch and it returns nothing.

    Where did I do wrong?
    Please help

User Tag List

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
  •  

 

 
DMCA.com