+ Reply to Thread
Results 1 to 4 of 4

Disable textboxes if Combobox is not selected first

  1. #1
    Forum Contributor
    Join Date
    02-26-2013
    Location
    Philippines
    MS-Off Ver
    Excel 2007
    Posts
    367

    Disable textboxes if Combobox is not selected first

    Hello, i have a userform with combobox and textboxes and commandbuttons.

    I just want to disable the textboxes if user didn't pick a month.

    Example: If user try to enter a data in a textboxes without picking a month first, a message will prompt "Please Select a month".

    I have a code for this, but when i select the commandbutton or exit the userform without selecting a date, it still prompting the message. I want this for textboxes only.

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

  2. #2
    Forum Contributor
    Join Date
    01-24-2011
    Location
    Sheppey
    MS-Off Ver
    Excel 2010
    Posts
    239

    Re: Disable textboxes if Combobox is not selected first

    Might not be the solution you want, but what I do to force an entry is to make the other boxes non-visable, nice and simple.

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: Disable textboxes if Combobox is not selected first

    Hi puuts

    Eliminate this Code
    Please Login or Register  to view this content.
    Add this Code for each TextBox
    Please Login or Register  to view this content.
    John

    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.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Disable textboxes if Combobox is not selected first

    Similar idea, I would use the _Change event of the prior form controls to enable/disable the coming controls. This way they are all visible, but greyed out until appropriate

    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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