+ Reply to Thread
Results 1 to 9 of 9

Link text Box to Combobox in Userform and autoupdate database

  1. #1
    Registered User
    Join Date
    12-26-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007
    Posts
    26

    Lightbulb Link text Box to Combobox in Userform and autoupdate database

    Hi,

    I am pretty new to VBA programming. I am new to programming of any kind all together. However, I am required to prepare an excel userform in which a user can select a value from the drop down combobox and the text box is linked to the corresponding column. The combobox gets its value from a database in the same sheet. Further if the value is not present, user can type the value in both the boxes. I have tried to do it myself, seeking help from various forums but m not able to do it.

    Please Help me with this.

    P.S. would it be possible to add the value in the data base automatically, if it is typed by the user.



    Please Login or Register  to view this content.
    Thanks.
    Attached Files Attached Files
    Last edited by pike; 01-21-2012 at 03:59 AM. Reason: request by john55 for solved prefix

  2. #2
    Registered User
    Join Date
    12-26-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Link text Box to Combobox in Userform and autoupdate database

    Bump no response

  3. #3
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Link text Box to Combobox in Userform and autoupdate database

    hi abhiD,
    as an option try this and see if it helps you!
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards, John55
    If you have issues with Code I've provided, I appreciate your feedback.
    In the event Code provided resolves your issue, please mark your Thread as SOLVED.
    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

    ...enjoy -funny parrots-

  4. #4
    Registered User
    Join Date
    01-03-2012
    Location
    Ohio
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Link text Box to Combobox in Userform and autoupdate database

    What if I just wanted to update a selection from the combo box instead of adding a new selection?

  5. #5
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Link text Box to Combobox in Userform and autoupdate database

    hi abhiD,
    thank you for the rep! hope it helped you!
    If your problem is solved, please say so clearly, and mark your thread as Solved:
    Click the Edit button on your first post in the thread,
    Click Go Advanced, select [SOLVED] from the Prefix dropdown, then
    click Save Changes.

  6. #6
    Registered User
    Join Date
    12-26-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Link text Box to Combobox in Userform and autoupdate database

    @john55

    thanks for the advise. The first part of the problem is indeed solved, but the second part, which is that if the part is not listed in the list a user can enter for the same in the boxes and then add that part to the master data base. in a sense the form has to work both the ways to pull values from the database and add the value there as well. I tried giving it a shot using check box, in which user will check the box in case the value is not listed in the combo box, and on clicking add button the value from the combo box and refrence no will be added to specifed columns in the master data base.

    But again, i have hit a road block..

  7. #7
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Link text Box to Combobox in Userform and autoupdate database

    abhid, did you try to add something (what you did not find in yr combobox) and then click ok button?!
    I tested it with "123", which is not listed, and clicked ok, "123" and the "aaa", "bbb" (for both textboxes) are sent to yr sheet!
    or...did I miss something?

  8. #8
    Registered User
    Join Date
    12-26-2011
    Location
    Bangalore,India
    MS-Off Ver
    Excel 2007
    Posts
    26

    Re: Link text Box to Combobox in Userform and autoupdate database

    @john

    Ya.. i checked it again, its working, i was trying to be overtly smart by using a check box..!:P
    thanks for the help man..!

    and i am not able to edit the first post hence cannot make it solved. I dunno why is that happening. Will mail the forum regulators regarding this..!
    thanks newes.
    Last edited by abhiD; 01-20-2012 at 06:52 AM. Reason: cannot change status to solved

  9. #9
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,060

    Re: Link text Box to Combobox in Userform and autoupdate database

    you're welcome!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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