Why declare LIChk variable? It isn't used.
There is no table of users and passwords. There is nothing to compare a user's input with. Need at least one record with a password value to compare to. Are passwords supposed to be associated with username? I set up a table with one field and two records for passwords 'admin', 'other'.
Also didn't provide frmSetCloseState so code will fail on line to open form.
Code:
If IsNull(Forms!frmPassword!Text0) Then 'No Blank passwords allowed
MsgBox "You cannot enter a blank Password. Try again."
Me!Text0.SetFocus
Else
'No More Than 3 Attempts Allowed
If Me.LIChk > 2 Then
MsgBox "You may not make more than three Password entry attempts.", vbCritical + vbOKOnly, "Oops!"
DoCmd.Quit
ElseIf IsNull(DLookup("Password", "Validation", "Password='" & Me.Text0 & "'")) Then
Me.LIChk = Me.LIChk + 1
MsgBox "The Password you entered is incorrect." & vbCrLf & _
"Please enter your correct Password or contact your Application " & _
"Administrator.", vbOKOnly, "Password " & Me.Text0.Value & " Incorrect"
Else
If Forms!frmPassword!Text0 = "admin" Then
DoCmd.OpenForm "frmSetCloseState"
DoCmd.Close acForm, Me.Name
Else
'do something for other users
End If
End If
End If