spectrolab
Registered User.
- Local time
- Today, 21:40
- Joined
- Feb 9, 2005
- Messages
- 116
Hi Everyone,
I have a bit of a question, I'm not sure if it even possbile after many hours of searching. I have the following LOGIN Form code:
It was put together from a quite a few posts and a lot of trial and error.
What I want to do is for Case 3, the lowest access level, is to automatically hide the navigation pane (Access 2007) but leave it available for Access levels 1 and 2. I know how to hide it in a ACCDE, but then it isn't available to the people who need it.
Is there someway this can be done in VBa?
Many thanks for any help.
Nigel
I have a bit of a question, I'm not sure if it even possbile after many hours of searching. I have the following LOGIN Form code:
Code:
Private Sub cmdLogin_Click()
Dim strUser As String
Dim strPWD As String
Dim intUSL As Integer
'Check to see if data is entered into the UserName combo box
If IsNull(Me.cboEmpID) Or Me.cboEmpID = "" Then
MsgBox "You must enter a User Name.", vbOKOnly, "Required Data"
Me.cboEmpID.SetFocus
' Exit Sub
End If
'Check to see if data is entered into the password box
If IsNull(Me.txtPassword) Or Me.txtPassword = "" Then
MsgBox "You must enter a Password.", vbOKOnly, "Required Data"
Me.txtPassword.SetFocus
Exit Sub
End If
'Check value of password in tblEmployees to see if this
'matches value chosen in combo box
If Me.txtPassword.Value = DLookup("Password", "tblEmployees", _
"[EmpID]=" & Me.cboEmpID.Value) Then
strUser = Me.cboEmpID.Value
intUSL = DLookup("[SecurityGroup]", "tblEmployees", "[EmpID]=" & Me.cboEmpID.Value)
Forms!frmUSL.txtUN = strUser
Forms!frmUSL.txtUSL = intUSL
Select Case intUSL
Case 1
DoCmd.OpenForm "frmLIMSMainMenu", acNormal
Case 2
DoCmd.OpenForm "frmLIMSMainMenu", acNormal
Forms![frmLIMSMAinMenu]![cmdRunningTotals].Visible = False
Case 3
DoCmd.OpenForm "frmLIMSMainMenu", acNormal
Forms![frmLIMSMAinMenu]![cmdRunningTotals].Visible = False
Forms![frmLIMSMAinMenu]![cmdRemove].Visible = False
End Select
DoCmd.Close acForm, "frmLogin", acSaveNo
Else
MsgBox "Password Invalid. Please Try Again", vbOKOnly, _
"Invalid Entry!"
Me.txtPassword.SetFocus
End If
intLogonAttempts = intLogonAttempts + 1
If intLogonAttempts > 3 Then
MsgBox "You do not have access to this database.Please contact admin.", _
vbCritical, "Restricted Access!"
Application.Quit
End If
It was put together from a quite a few posts and a lot of trial and error.
What I want to do is for Case 3, the lowest access level, is to automatically hide the navigation pane (Access 2007) but leave it available for Access levels 1 and 2. I know how to hide it in a ACCDE, but then it isn't available to the people who need it.
Is there someway this can be done in VBa?
Many thanks for any help.
Nigel