Help!
I have an application that selects user and the user's security level. It works fine until for no reason it stops and when I stepped through it I found that the Case value was getting set to nothing but the user value reamained which is good. The case variable is global. Do I need to requery? How can I make access retain that value?
CODE
Private Sub Form_Open(Cancel As Integer)
Select Case (strSecLvl)
Case "Developer"
Debug.Print "User"
'Set form properties for Developer
Case "Administrator"
'Set form properties for Administrator
Case "Maintenance"
'Set form properties for Maintenance
Case "Receiving"
'Set form properties for Receiving
DoCmd.Close acForm, "UserLogIn"
Case "Read Only"
'Set form properties for Read Only
Case Else
MsgBox "The user name with which you have logged in " & _
"is not cleared for access to this screen." & vbCrLf & vbCrLf & _
"Please check your security settings.", vbCritical, "Security Error !"
DoCmd.Close acForm, "Assets_New"
End Select
End Sub
Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.
I have an application that selects user and the user's security level. It works fine until for no reason it stops and when I stepped through it I found that the Case value was getting set to nothing but the user value reamained which is good. The case variable is global. Do I need to requery? How can I make access retain that value?
CODE
Private Sub Form_Open(Cancel As Integer)
Select Case (strSecLvl)
Case "Developer"
Debug.Print "User"
'Set form properties for Developer
Case "Administrator"
'Set form properties for Administrator
Case "Maintenance"
'Set form properties for Maintenance
Case "Receiving"
'Set form properties for Receiving
DoCmd.Close acForm, "UserLogIn"
Case "Read Only"
'Set form properties for Read Only
Case Else
MsgBox "The user name with which you have logged in " & _
"is not cleared for access to this screen." & vbCrLf & vbCrLf & _
"Please check your security settings.", vbCritical, "Security Error !"
DoCmd.Close acForm, "Assets_New"
End Select
End Sub
Homer: But every time I learn something new, it pushes out something old! Remember that time I took a home wine-making course and forgot how to drive?
Marge Simpson: That's because you were drunk!
Homer: And how.