in the below code I have it set up to ask for a password when an employee chooses there name in a drop down combo box. if the employee enteres wrong password the the cell should say bad password and the cell should show "". This works on the first one I did, but on the other five which i just copied and pasted changing only the combo box# trigger if the employee puts in the wrong password it says wrong password but still enters there name.
Private Sub cmb4_change()
Dim pwd As String
Dim Oops As Boolean
If LockEvent Then Exit Sub
LockEvent = True
'Application.EnableEvents = False
pwd = Application.InputBox("Password for " & cmb1.Value & ":", "Enter Password", Type:=2)
If pwd = "" Then
cmb1.Value = ""
LockEvent = False
'Application.EnableEvents = True
Exit Sub
End If
Select Case cmb1.Value
Case "J. Flack"
If pwd <> jflack Then Oops = True
Case "C. Robinson"
If pwd <> crobinson Then Oops = True
Case "O. Contreras"
If pwd <> ocontreras Then Oops = True
Case "R. Saling"
If pwd <> rsaling Then Oops = True
Case "T. Pace"
If pwd <> tpace Then Oops = True
Case "A. Curtis"
If pwd <> acurtis Then Oops = True
Case Else
Oops = True
End Select
If Oops Then
MsgBox "Bad password"
cmb1.Value = ""
End If
LockEvent = False
'Application.EnableEvents = True
Bookmarks