I created this form for security purposes, and on the button ( Enter ) I
did this
Private Sub cmd3_Click()
On Error GoTo Err_cmd3_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim txtPasword As String
txtPassword = "7389"
stDocName = "Switchboard"
If txtPassword = "7389" Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Can't log on. Username and password do not match. "
End If
Exit_cmd3_Click:
Exit Sub
Err_cmd3_Click:
MsgBox Err.Description
Resume Exit_cmd3_Click
End Sub
It's not working, why?
I just started learning VB, any ideas?
did this
Private Sub cmd3_Click()
On Error GoTo Err_cmd3_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim txtPasword As String
txtPassword = "7389"
stDocName = "Switchboard"
If txtPassword = "7389" Then
DoCmd.OpenForm stDocName, , , stLinkCriteria
Else
MsgBox "Can't log on. Username and password do not match. "
End If
Exit_cmd3_Click:
Exit Sub
Err_cmd3_Click:
MsgBox Err.Description
Resume Exit_cmd3_Click
End Sub
It's not working, why?
I just started learning VB, any ideas?