I'm trying to enable a textbox if the password is entered correctly else no entry. I'm getting a type mismatch error
This is my code, on gotfocus, the textbox "responsibility"
Private Sub Responsibility_GotFocus()
Dim strInput As String, strMsg As String
strMsg = "Enter the password."
strInput = InputBox(Prompt:=strMsg, Title:="Password", XPos:=2000, YPos:=2000)
If strInput = "QUERY" Then
MsgBox "Hello Nancy, "
Responsibility.Enabled = True
Else
MsgBox "that's incorrect"
Responsibility.Enabled = False
NoEntry
End If
End Sub
This is my code, on gotfocus, the textbox "responsibility"
Private Sub Responsibility_GotFocus()
Dim strInput As String, strMsg As String
strMsg = "Enter the password."
strInput = InputBox(Prompt:=strMsg, Title:="Password", XPos:=2000, YPos:=2000)
If strInput = "QUERY" Then
MsgBox "Hello Nancy, "
Responsibility.Enabled = True
Else
MsgBox "that's incorrect"
Responsibility.Enabled = False
NoEntry
End If
End Sub