Results 1 to 4 of 4

Disable textboxes if Combobox is not selected first

Threaded View

  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.

    
    Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
        If Me.ComboBox1.ListIndex = -1 Then
            MsgBox "Please select a month", vbExclamation + vbCritical, "Error"
            Cancel = True
            Exit Sub
        End If
    End Sub
    Attached Files Attached Files

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