+ Reply to Thread
Results 1 to 7 of 7

Content of a Textbox populates a ComboBox

  1. #1
    Registered User
    Join Date
    01-21-2014
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2011
    Posts
    13

    Content of a Textbox populates a ComboBox

    I started with a new company a few months ago on a project where we are transitions the entire company from the old parts inventory system that was independent to a global system linking all 18 locations.

    Already we have an Excel userform that I created that allows us to search by either the old inventory systems dummy number or the part number. The issue is the part number entry needs to be exact to what I copied from the plants database (ie. if the plant used # 345-D-997 and the stamped part number is #345 D 997 no result will display). The way I would like to approach this is a textbox that users can enter a portion of the number, this would then populate a combobox with the matches that contain the entry. I however don't have the slightest idea how to begin programming that. Can anyone shed some light on how to best achieve this?

    I have included the code I'm currently using. My skills in VBA are very entry level and I'm afraid what I'm asking to achieve might be a bit above my head but I really would like to get something going. On average we are sorting through less than 1,000 parts if that matters for the type of code I can use.

    3a.jpg

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Content of a Textbox populates a ComboBox

    What you ask is quite simple.

    I would help if you had posted a workbook.

    Failing that the attached shows you how to do it:-

    Type dal into one textbox, ch into the second ro into the third.


    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 04-12-2016 at 04:39 PM.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  3. #3
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Content of a Textbox populates a ComboBox

    If I am understanding correctly, you can use just the combobox as this will populate the closest match as the user types in the combobox. You can also have the combobox automatically have the list of data in it for the user to select and set the combobox property to Match.

    Can you attach a sample workbook of what you have with the UserForm and code you are using, along with a sample list that you want in the combobox?
    1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG
    You don't have to add Rep if I have helped you out (but it would be nice), but please mark the thread as SOLVED if your issue is resolved.

    Tom

  4. #4
    Forum Expert gmr4evr1's Avatar
    Join Date
    11-24-2014
    Location
    Texas
    MS-Off Ver
    Office 2010 and 2007
    Posts
    3,448

    Re: Content of a Textbox populates a ComboBox

    Looks like mehmetcik came up with a solution.

  5. #5
    Registered User
    Join Date
    01-21-2014
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Content of a Textbox populates a ComboBox

    Can I ask why am I typing "dal" "ch" and "ro" into the text box's?

    I have also included a snip of the workbook, I don't know how to upload the entire workbook on here simply.

    Thank you!

    Quote Originally Posted by mehmetcik View Post
    What you ask is quite simple.

    I would help if you had posted a workbook.

    Failing that the attached shows you how to do it:-

    Type dal into one textbox, ch into the second ro into the third.


    Please Login or Register  to view this content.
    10.JPG

  6. #6
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Content of a Textbox populates a ComboBox

    That shows you how the code works.

    Then you can modify it.

  7. #7
    Registered User
    Join Date
    01-21-2014
    Location
    Memphis, TN
    MS-Off Ver
    Excel 2011
    Posts
    13

    Re: Content of a Textbox populates a ComboBox

    Scratch what I originally posted, so I have it working now that it returns values to either my Listbox or ComboBox. Problem is I can't clear the old values with my "Clear" Button. Thoughts?

    The other issue is I've managed to get the code to populate either a combo box or list box with the appropriate results. I've trying to run the same code I used for the first search box which I have an example of below. I am guessing since both of these boxes are dynamic in that they are showing results and now running off of a manually entered value. What would be the best way to populate my fields with the results?

    This is my code currently. I've tried both when you use the combobox dropdown you highlight your selected part and hit enter, no luck. Then I tried you highlight your selected part and use the "Go" button to fire the code to run on that selected part, it keeps bugging out.

    Please Login or Register  to view this content.
    Last edited by Scubaru; 04-13-2016 at 02:58 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 9
    Last Post: 09-16-2015, 08:00 PM
  2. Replies: 0
    Last Post: 08-18-2015, 04:13 PM
  3. Word Combobox and Textbox content control
    By superdonk in forum Word Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2015, 01:22 AM
  4. Replies: 0
    Last Post: 11-07-2014, 11:41 AM
  5. Populating Userform ComboBox Using Items from Content Control Combobox
    By anarxo in forum Word Programming / VBA / Macros
    Replies: 2
    Last Post: 01-17-2014, 01:00 PM
  6. [SOLVED] VBA Userform ComboBox: Content of ComboBox based off of Conditional Statement
    By Brianandstewie in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-16-2013, 03:00 PM
  7. [SOLVED] Userform Combobox selection populates wrong data in the textboxes
    By yahya263 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2013, 09:46 AM

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