I have a password form in Access 97. I want to give 3 chances and then go back to the Main Menu. My code (below) works if you enter the correct Password (SPL. It does not work if you enter an incorrect password.
Dim passcount as integer
If me.text21 = “SPL” then
me.text21 = Null
Docmd.openform “Secretary Changes”, acnormal, “”, “”, , acWindow Normal
Else if me.text21 <> “SPL” then
Do until passcount =3
me.text21.setfocus
me.text21 = ” ”
passcount = passcount + 1
Loop
end if
‘go to Main Menu