Static intBadLogins As Integer
Static intBadLoginsPass As Integer
Dim Find As String '//Find Administrator ID
Dim Pass As String '//Find Administrator Password
On Error GoTo ErrorNoLan
Find = txtUserID.Text
If Find = "" Then
MsgBox "Please Enter Your Login ID"
txtUserID.SetFocus
Exit Sub
Else '//in find method use field name within table
mrstLogin.Find "UserID = " _
& "'" & Find & "'"
If mrstLogin.EOF Then
intBadLogins = intBadLogins + 1
If intBadLogins = 3 Then
MsgBox " Opps--- three tries and you're out!"
intBadLogins = 0
txtUserID.Text = ""
txtPassword.Text = ""
'frmCalStandards.Show
Call CloseMe
Unload frmLogin '//Only 3 tries then your outa here
frmISO.Show
Unload frmCalStandards
Exit Sub
Else
MsgBox "The Current Logon ID is incorrect. Please" _
& "Try Again ...", vbOKOnly
txtUserID.Text = ""
txtPassword.Text = ""
txtUserID.SetFocus
mrstLogin.MoveFirst
Exit Sub
End If
End If
End If
Pass = txtPassword.Text
If Pass = "" Then
MsgBox "Please Enter Your Logon Password"
txtPassword.SetFocus
Exit Sub
Else '//in find method use field name within table
mrstLogin.Find "Password = " _
& "'" & Pass & "'"
If mrstLogin.EOF Then
intBadLoginsPass = intBadLoginsPass + 1
If intBadLoginsPass = 3 Then
MsgBox " Opps--- three tries and you're out!"
intBadLoginsPass = 0
txtUserID.Text = ""
txtPassword.Text = ""
frmCalStandards.Show
Call CloseMe
Unload frmLogin '//Only 3 tries then your outa here
Exit Sub
Else
MsgBox "The Current Password is incorrect. Please" _
& "Try Again ...", vbOKOnly
txtPassword.Text = ""
txtPassword.SetFocus
mrstLogin.MoveFirst
Exit Sub
End If
End If
End If