declare either a public integer variable in a module, or a form level integer variable (in the General Declarations section of the code view)in your Login form, such as intCounter. Use this variable to count the number of times the user has incorrectly logged in. Each time the user enters incorrect login information, increment the counter by 1. After incrementing the counter, then test to see if it equals 3.
If it equals 3, simply send the user a message:
- msgbox "The program will now close."
and kill the app.
- End
It should work for you....hope it helps