Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

User Name Password Coding 1

Status
Not open for further replies.

itmasterw

Programmer
Apr 13, 2003
147
US
I have wrote the code here, that works to ask a user to enter a user name and password, but I would like to set a limit to only alow the user to try 4 times and then be sent back to the main form. Everyhting I have tried so far doesnt work. Any Ideas I would apperaciate.
 
use a static integer and increment it by 1 every time that there is a login attempt made. when the integer hit's the limit that you want then send it back to the form.
 

Yeh, I agree with DirectDrive. I wrote this before I read Direct's post but you may as well see if it's useful for you.


Public ipwdCount As Integer


Private Sub cmdSubmit_Click()

If ipwdCount < 4 Then
ipwdCount = ipwdCount + 1
'Process Logon Here
Else
Unload Me
'Run cancel code
End If

End Sub

Private Sub Form_Load()

ipwdCount = 0

End Sub
 
Thanks I never used a static integer before, but I will look it up try it. Thank you
 

Oh I forgot to add, put all the code in the code for your logon form and the public variable will be reloaded and set to 1 everytime you load the form.


 
Thanks these are all great ideas and I learned a few more things form your help. I did get to work.
Thank You for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top