+ Reply to Thread
Results 1 to 11 of 11

Auto populate Textboxes fro Combobox selection

  1. #1
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Auto populate Textboxes fro Combobox selection

    Hi,

    I've just read a few similar threads but cant seem to work out my problem

    I am using the following code to show only the unique:
    Please Login or Register  to view this content.
    Following the 'NJReportedCB' there are 2 Textboxes: 'NJTelephoneTB' & 'NJEmailB'.

    How can I get the 2 Textboxes to auto fill with the corresponding data from the ComboBox selection's row.

    I thought this was really simple but i'm struggling and getting stressed

    Any help greatly appreciated.

    Thanks,

    Cuba

  2. #2
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Auto populate Textboxes fro Combobox selection

    If there can be many rows for one item in combo box, what will the text boxes show?
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  3. #3
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Auto populate Textboxes fro Combobox selection

    The reported always has the same telephone and email, there is many rows that show Reception, 020 7123 4567 and [email protected] in columns E, F & G.

    I am trying to avoid making another table for contact details and typing them out every time is defeating the goal of the userform.

  4. #4
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: Auto populate Textboxes fro Combobox selection

    You may assign the three columns to the list:
    Please Login or Register  to view this content.
    for example.

  5. #5
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Auto populate Textboxes fro Combobox selection

    I can't get it to work!

    Should I be placing it under UserForm_Initialize() or somewhere else?

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Auto populate Textboxes fro Combobox selection

    I don't understande why you need a textbox for tel# that is in Combobox...
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Auto populate Textboxes fro Combobox selection

    OK, Sorry, don't think I'm getting it, probably my rubbish description.

    Here's an example.

    Example3.xlsm

    When a selection is made from the 'Reported By' ComboBox1 I would like it to automatically fill the following Textboxes from the entries already in the table.

    Thanks again and Happy New Year

  8. #8
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Auto populate Textboxes fro Combobox selection

    Sorry attachment not working
    Attached Files Attached Files
    Last edited by Cuba64; 12-31-2013 at 09:07 PM.

  9. #9
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Auto populate Textboxes fro Combobox selection

    But it has all the code... Please Help

  10. #10
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: Auto populate Textboxes fro Combobox selection

    If this is not what you wanted, just ignore it.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    12-18-2012
    Location
    London
    MS-Off Ver
    Excel 365
    Posts
    32

    Re: Auto populate Textboxes fro Combobox selection

    This works great in the example but when I copy the code in to my app it throws up a compile error when I make a selection from the combobox!

    Sub or Function not defined

    Would it be possible for comments to be put in the code so I understand what's happening?

    The Debuging highlights the Combobox and the line: .NJTelephoneTB = Dic(.NJReportedCB.Value)(0) The Dic is highlighted!

+ 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: 4
    Last Post: 03-02-2014, 03:33 AM
  2. Load data (list) into multipe textboxes using a combobox selection
    By Martijn79 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-16-2013, 03:48 AM
  3. [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
  4. Textboxes within Userform to display info based on combobox selection
    By alter54 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-28-2012, 12:40 PM
  5. Populate several TextBoxes from a ComboBox selection
    By D3Pratt in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-31-2009, 12:19 PM

Tags for this Thread

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