Hi all
I have a mdb with login name and password form. There are several login names, i defined through a table "User_login ". Here the problem is at a time a single user is able to login in multible system, which i want to restrict.
here is the code which i i am using for login check.....
can anyone please help on this..........
Regards
yuvan
<E-mail address removed>
I have a mdb with login name and password form. There are several login names, i defined through a table "User_login ". Here the problem is at a time a single user is able to login in multible system, which i want to restrict.
here is the code which i i am using for login check.....
Code:
Private Sub cmblogin_Click()
Static intlogonattempts As Integer
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cmbname) Or Me.cmbname = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cmbname.SetFocus
Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.cmbpass) Or Me.cmbpass = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.cmbpass.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.cmbpass.Value = DLookup("Password_login", "user_login", "[id]=" & Me.cmbname.Value) Then
emp_name = Me.cmbname.Value
intlogonattempts = 0
'Close logon form and open splash screen
cmbname.SetFocus
Me.Visible = False
DoCmd.OpenForm "As Laid Backlog Digitization Database"
Else
intlogonattempts = intlogonattempts + 1
If intlogonattempts > 3 Then
MsgBox "Sorry! You do not have access to this database.Please contact admin.", vbCritical, "Restricted Access!"
Application.Quit
End If
MsgBox "Password Invalid. Please Try Again", vbOKOnly, "Invalid Entry!"
Me.cmbpass.SetFocus
End If
End Sub
can anyone please help on this..........
Regards
yuvan
<E-mail address removed>
Comment