+ Reply to Thread
Results 1 to 10 of 10

Reverse combobox and textbox dependency in Userform

  1. #1
    Registered User
    Join Date
    09-06-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    69

    Reverse combobox and textbox dependency in Userform

    Hello,

    I am trying to make the Project Name box details be dependent on the Project Number selected in a combobox drop down selection. Essentially, I am trying to reverse the dependency which is already in place (right now the Project Name controls what is displayed in the Project Number text box). I've tried renaming the Project Name Combobox to the original name of the ProjectNumber box, and reversing the code in the back which controls the change of the Project Name.

    Unfortunately my attempts have not worked. Can someone assist?

    My form is attached:

    This is the code which is causing me issues:

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Reverse combobox and textbox dependency in Userform

    Hi there

    Please help me understand....Are you wanting to select the project number and have the project name appear
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    09-06-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    69

    Re: Reverse combobox and textbox dependency in Userform

    Quote Originally Posted by sintek View Post
    Hi there

    Please help me understand....Are you wanting to select the project number and have the project name appear
    Hi Sinitek, that's exactly it! Right now, it works so that you select the Project Name and then the Project Number appears. I would like it in reverse...

  4. #4
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Reverse combobox and textbox dependency in Userform

    Then you need to change the scenario around....Make the Project number a comboBox and the Project name a textbox and then edit your code for the lookup

  5. #5
    Registered User
    Join Date
    09-06-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    69

    Re: Reverse combobox and textbox dependency in Userform

    HiSintek, I thought it would be that simple too..but the form keeps erroring out when I just do....

  6. #6
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Reverse combobox and textbox dependency in Userform

    This should help.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Reverse combobox and textbox dependency in Userform

    Hi excelconditional

    Sorry was out most of the day...see bakerman2 sorted you out....Anyway herewith another way whereby ProjectNumber is combobox...
    See attached...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 06-20-2017 at 01:56 PM.

  8. #8
    Registered User
    Join Date
    09-06-2016
    Location
    UK
    MS-Off Ver
    2016
    Posts
    69

    Re: Reverse combobox and textbox dependency in Userform

    Thank you both, Sintek and Bakerman. Both codes do the job!

  9. #9
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,907

    Re: Reverse combobox and textbox dependency in Userform

    You're welcome and thanks for rep+.

  10. #10
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,234

    Re: Reverse combobox and textbox dependency in Userform

    Glad we could help....Thanks for rep

+ 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: 0
    Last Post: 08-18-2015, 04:13 PM
  2. Trying to populate a userform combobox from a userform textbox
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-31-2014, 03:33 PM
  3. [SOLVED] Pass Value of combobox selected in Userform as input to textbox of other userform
    By Pradeepg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-29-2013, 10:32 AM
  4. input the value of a Combobox and a textbox to a TEXTBOX directly from a userform
    By Gordonhk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-11-2013, 03:25 PM
  5. [SOLVED] Excel Userform: Populate other controls (i.e. textbox & combobox) based on combobox select
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-22-2013, 04:50 PM
  6. Userform: Combobox value to WorkSheet Textbox
    By lankan12 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2011, 01:56 AM

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