You can use a public variable for this purpose.
You can define the public variable with module (form) scope as below.
option explicit
dim gbliNumLoginAttempts as integer
You have to put this outside any events.
Then you can increment it in each failed login attempt. When its value reaches 3, you can do the required action.
|