If Me.PASS.Value = Nz(DLookup("Password", "tblEmployees", "[Employee]=" & Chr(34) & Me.EMP.Value & Chr(34)), vbNullString) Then
gstrUserName = Me.EMP.Value
gstrPassword = Me.PASS.Value
'Close logon form and open splash screen
DoCmd.Close acForm, "UserNew", acSaveNo
DoCmd.OpenForm "Data"
Else
Countabc = Countabc + 1
If Countabc > 3 Then
MsgBox "You do not have access to this database. Please contact your system administrator.", vbCritical, "Restricted Access!"
Application.Quit
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.PASS.SetFocus
End If
End If
Me.EMP.SetFocus
I actually wanna close the appilcation if the passwrod is incorrect for 3 times....
Please advise if the above code is incorrect....