mithani
Registered User.
- Local time
- Tomorrow, 05:51
- Joined
- May 11, 2007
- Messages
- 291
Hello,
Can anyone help me please.
I have got my own user password screen which protect my software to use unauthorized person.
What I am looking for is, I want to display username on everyscreen. How would I save a current user?. Here is a code of user password screen
I appreciate your help
mithani
Can anyone help me please.
I have got my own user password screen which protect my software to use unauthorized person.
What I am looking for is, I want to display username on everyscreen. How would I save a current user?. Here is a code of user password screen
Code:
[FONT=Calibri]Private Sub cmdLogin_Click()[/FONT]
[FONT=Calibri] If IsNull(Me.cboEmployee) Or Me.cboEmployee = "" Then[/FONT]
[FONT=Calibri] MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"[/FONT]
[FONT=Calibri] Me.cboEmployee.SetFocus[/FONT]
[FONT=Calibri] Exit Sub[/FONT]
[FONT=Calibri] End If[/FONT]
[FONT=Calibri] If IsNull(Me.txtpassword) Or Me.txtpassword = "" Then[/FONT]
[FONT=Calibri] MsgBox "You must enter a Password.", vbOKOnly, "Required Data"[/FONT]
[FONT=Calibri] Me.txtpassword.SetFocus[/FONT]
[FONT=Calibri] Exit Sub[/FONT]
[FONT=Calibri] End If[/FONT]
[FONT=Calibri] If Me.txtpassword.Value = DLookup("strEmpPassword", "tblEmployees", _[/FONT]
[FONT=Calibri] "[lngEmpID]=" & Me.cboEmployee.Value) Then[/FONT]
[FONT=Calibri] lngMyEmpID = Me.cboEmployee.Value[/FONT]
[FONT=Calibri] DoCmd.Close acForm, "frmDatabaseLogon", acSaveNo[/FONT]
[FONT=Calibri] Else[/FONT]
[FONT=Calibri] MsgBox "Password Invalid. Please Try Again", vbOKOnly, _[/FONT]
[FONT=Calibri] "Invalid Entry!"[/FONT]
[FONT=Calibri] Me.txtpassword.SetFocus[/FONT]
[FONT=Calibri] End If[/FONT]
[FONT=Calibri] intLogonAttempts = intLogonAttempts + 1[/FONT]
[FONT=Calibri] If intLogonAttempts = 3 Then[/FONT]
[FONT=Calibri] MsgBox "You do not have access to this database.Please contact admin.", _[/FONT]
[FONT=Calibri] vbCritical, "Restricted Access!"[/FONT]
[FONT=Calibri] Application.Quit[/FONT]
[FONT=Calibri] End If[/FONT]
[FONT=Calibri]End Sub[/FONT]
I appreciate your help
mithani
Last edited: