+ Reply to Thread
Results 1 to 19 of 19

Fill ComboBox

  1. #1
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Fill ComboBox

    Good Morning everyone.
    Yesterday I got help on filling a listbox from here and the problem was solved with all the great help I got, snb told me I wouldbe better off with a Combobox instead of a listbox. I changed the listbox to combobox with the new code and it only fills in one row. I'm I doing something wrong or will the combobox only fill one row from list. Looking to fill row 3,4. form2 is the one I'm working on.
    Thanks
    Attached Files Attached Files
    Last edited by zplugger; 02-10-2011 at 01:43 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: assistance with filling ComboBox

    The Combobox seems to fill Ok. Why are you using a Multicolumn ComboBox. What exactly do you want to display in the second Combobox
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: assistance with filling ComboBox

    I was hoping for Location, Actors in Combobox2.

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: assistance with filling ComboBox

    Then use a ListBox, I'm sure that you can't display 3 Columns of a ComboBox

  5. #5
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: assistance with filling ComboBox

    Isn't he filling the second combobox from the first combobox list?

    Should he be filling the first combobox with Sheet2 Column A(movie) and then filling the second combobox from Sheet2 Columns C(loc) & D(actors)?
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  6. #6
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: assistance with filling ComboBox

    I'm not really sure why he has taken this approach at all

  7. #7
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: assistance with filling ComboBox

    just from suggestion, I will return too listbox. Thanks

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: assistance with filling ComboBox

    Can you clear up what the purpose of the userform is? I saw your original code yesterday & it was way overcomplicated

  9. #9
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: assistance with filling ComboBox

    Hello royUK, the purpose of the userform is to search the database and find a movie and show location and what actors are in it. The form I post is a example of what I want. The listbox works ok except it stays highlighted when a movie is found,which is no big problem. The lookup actor form works perfect, just trying to have a form to lookup movie and work the same as lookup actor. I know you guys are experts on this stuff and I'm a newbe with little knowledge on this. I have gotten a lot of great help from this site and you guys are he greatest. The form will work ok for me, thanks again for all your help. One reason I went to a Comboxbox instead of a listbox was the combobox did not stay highlight aftem a movie pick.
    Z

  10. #10
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Fill ComboBox

    Z,
    Take a look at this and see if this would work any better for you. I modified your Userform2 just a little bit and used two seperate textboxes vs the combobox2.

    I also edited the code on UserForm2 to load the combobox when the Userform loads and associated the Number and Actor in the row for each Movie.


    ......pick a Movie out of ComboBox1,
    ..... then the Number from Sheet2 Column C and the Actor(s) from Sheet2 Column D show up in the two textboxes for you.
    Attached Files Attached Files

  11. #11
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Fill ComboBox

    Thanks for your time jwright650, I like this idea. The only thing I see is if the boxes are filled with data and you type in a new movie it does not change the lower boxes auto.

  12. #12
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Fill ComboBox

    Here is another idea....deleted the actor textbox and have both Number and Actor appear in the single textbox....change the movie the actors change with it.
    Attached Files Attached Files

  13. #13
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Fill ComboBox

    Thanks again I like this too, The only thing is if a movie is pick and you change it does not fill the lower box auto. Lets say american pir has filled the data boxes, if I type in bait it does not auto fill the lower box. Thanks for taking your time for helping me.

  14. #14
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Fill ComboBox

    Quote Originally Posted by zplugger View Post
    The only thing is if a movie is pick and you change it does not fill the lower box auto.
    Are you hitting enter after you type in the new movie? If you use the drop down arrow in ComboBox1 and choose the movies that way, it updates automatically...at least on my machine it updates instantly.

  15. #15
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Fill ComboBox

    Ah...I see what you mean...I was choosing from the drop down arrows and it updates instantly, if you type in the movie, you have to click the combobox for it to update the textbox info. I think it is due to the clickevent code for the ComboBox1. Not sure how to fix that.

  16. #16
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Fill ComboBox

    Hi John
    If I use the arrow it works perfect, use the arrow and load the movie bait. After it is loaded type in american pie, it does not update the lower box on my machine.

  17. #17
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: Fill ComboBox

    Hmm, I'm not sure why it works for me and not you.....I need to read up and see if I can figure that one out.

  18. #18
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Fill ComboBox

    You seem to just make your code unnecessarily complicated, why aren't you using snb's code that he suggested before you changed to a ListBox?

  19. #19
    Forum Contributor
    Join Date
    03-05-2009
    Location
    usa
    MS-Off Ver
    Excel 2016 32Bit
    Posts
    1,173

    Re: Fill ComboBox

    Problem Fix, I'm using John's code and it works perfect after I change the ComboBox1_Click to ComboBox1_Change. Thanks for all your help guys on this.

+ 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