option explicit
Static cntr as Integer

Private Sub OKBtn_Click()
Dim db as Database ---for your database
Dim rs as Recordset - for password table

Set db=... open your db
set rs=... open the password table and look for the username
if not rs.BOF then '... if it exist
if rs!password=txtpassword.text Then '...if password is correct
unload me
frmMenu.Show
else
msgbox "Access denied.",vbExclamation,"Warning"
cntr=cntr + 1
end if
else
msgbox "Access denied.",vbExclamation,"Warning"
cntr=cntr + 1
end if

counterResult:
if cntr = 3 then
...put here whatever your condition is.
cntr = 0
end if
End Sub



Hope it could help or give you an idea...hekhek

regards:

jireh