whirlwindgirl
New member
- Local time
- Today, 09:02
- Joined
- Apr 13, 2011
- Messages
- 4
I have a switchboard that has options that only certain people can access. I have the code for the password protection, and it works. What I want is to insert code to go to the Main Switchboard after the Wrong Password box pops up. I've tried to insert it in several places, and I can't get it to work. Any Ideas? See below:
If Me.SwitchboardID = 2 Then
Dim x As String
x = "Password1"
Dim y As String
y = InputBox("Please Enter a Valid Password", "Password required")
If x <> y Then
MsgBox "Wrong password", , "Invalid Password"
DoCmd.OpenForm "Switchboard", acNormal, , , acFormReadOnly
End If
End If
If Me.SwitchboardID = 3 Then
Dim x1 As String
x1 = "Password2"
Dim y1 As String
y1 = InputBox("Please Enter a Valid Password", "Password required")
If x1 <> y1 Then
MsgBox "Wrong password", , "Invalid Password"
End If
End If
If Me.SwitchboardID = 4 Then
Dim x2 As String
x2 = "Password3"
Dim y2 As String
y2 = InputBox("Please Enter a Valid Password", "Password required")
If x2 <> y2 Then
MsgBox "Wrong password", , "Invalid Password"
End If
End If
If Me.SwitchboardID = 2 Then
Dim x As String
x = "Password1"
Dim y As String
y = InputBox("Please Enter a Valid Password", "Password required")
If x <> y Then
MsgBox "Wrong password", , "Invalid Password"
DoCmd.OpenForm "Switchboard", acNormal, , , acFormReadOnly
End If
End If
If Me.SwitchboardID = 3 Then
Dim x1 As String
x1 = "Password2"
Dim y1 As String
y1 = InputBox("Please Enter a Valid Password", "Password required")
If x1 <> y1 Then
MsgBox "Wrong password", , "Invalid Password"
End If
End If
If Me.SwitchboardID = 4 Then
Dim x2 As String
x2 = "Password3"
Dim y2 As String
y2 = InputBox("Please Enter a Valid Password", "Password required")
If x2 <> y2 Then
MsgBox "Wrong password", , "Invalid Password"
End If
End If