Results 1 to 22 of 22

Match Combobox with textbox then enable password: HOW TO?

Threaded View

  1. #1
    Registered User
    Join Date
    03-01-2018
    Location
    Philippines
    MS-Off Ver
    2003,2007,2010,2013 and 2016
    Posts
    51

    Post Match Combobox with textbox then enable password: HOW TO?

    Hello everyone.

    I have been trying to look for working codes for the userform to work flawlessly. Unfortunately, I couldn't find any code. I just wish you could help me how to do this. I have a sheet named "DATABASE" with names of schools in column A, school ID in column B, and password in column C.

    The combobox (cboStation) is populated already with the list of schools. What I need to do now is when a user select a specific school from the cboStation, the user can input the corresponding school id in the Textbox1. When Textbox1 matches with the selection in the cboStation, the password will be enabled. This means that when cboStation and Textbox1 don't match, the password area is disabled.

    Below are the codes within the userform:

    Private Sub UserForm_Initialize()
    
    cboStation.SetFocus
    
    Dim v, e
    With Sheets("DATABASE").Range("A2:A1000")
        v = .Value
    End With
    With CreateObject("scripting.dictionary")
        .comparemode = 1
        For Each e In v
            If Not .exists(e) Then .Add e, Nothing
        Next
        If .Count Then Me.cboStation.List = Application.Transpose(.keys)
    End With
    
    End Sub
    Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
    
    If CloseMode = 0 Then
            
        Cancel = True
        MsgBox "The X is disabled. Click CANCEL to Exit.", vbCritical, "BETA VERSION"
    
    End If
    
    End Sub
    Private Sub cancelbot_Click()
    
    Unload Me
    SaveChanges = False
    
    End Sub
    Attached Images Attached Images
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Userform Combobox for Username and textbox password
    By maroguy69 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2017, 08:59 AM
  2. [SOLVED] enable/disable combobox based on textbox entry
    By bqheng in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-05-2017, 11:53 AM
  3. VBA Macro to enable Save option without a password but enable Save As with password
    By WuonAlice in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-19-2016, 12:54 PM
  4. Replies: 0
    Last Post: 08-18-2015, 04:13 PM
  5. Combobox enable textbox
    By jpernice in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-24-2015, 09:16 PM
  6. [SOLVED] Vba vlookup & match value in combobox and textbox on a userform
    By kboy1289 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 12-13-2013, 03:24 PM

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