Hi,
I have designed a database with a multi-user login function. However the code I have used (shown below) does not restrict the number of times users can re-enter a password.
Is there a way of doing this, if so, can the program also be terminated after this sequence and the individual user locked out.
I have designed a database with a multi-user login function. However the code I have used (shown below) does not restrict the number of times users can re-enter a password.
Code:
Option Compare Database Private Sub Login_Click() UserName.SetFocus If UserName = "Staff1" And Password = "Staff1" Then MsgBox "Welcome" DoCmd.Close DoCmd.OpenForm "Staff1" ElseIf UserName = "Staff2" And Password = "Staff2" Then MsgBox "Welcome" DoCmd.Close DoCmd.OpenForm "Staff2" ElseIf UserName = "Manager1" And Password = "Manager1" Then MsgBox "Welcome, please exercise caution when changing query or table conditions", vbInformation, "CDSignatures" DoCmd.Close DoCmd.OpenForm "Manager1" Else MsgBox "Please re-enter Username and Password" End If End Sub
Comment