Greetings,
I am wanting to have a log on form that is coded that if a user has a specific user level value he will have a a message box open giving him the option to set the Bypass Key at true or false.
However, I want all other users not to have that message box generated so they would just open the main form with the bypass key not available to them.
I either get the option message box for all users or for no users.
I have tried various versions of the code but this is my basic one:
The message box appears even if the AccessLevel is a value other than 4.
Any ideas?
Thanks.
I am wanting to have a log on form that is coded that if a user has a specific user level value he will have a a message box open giving him the option to set the Bypass Key at true or false.
However, I want all other users not to have that message box generated so they would just open the main form with the bypass key not available to them.
I either get the option message box for all users or for no users.
I have tried various versions of the code but this is my basic one:
Code:
Dim AccessLevel As Integer
Dim prop As DAO.Property
Set prop = CurrentDb.CreateProperty("allowbypasskey", dbBoolean, False)
CurrentDb.Properties.Append prop
If rs![AccessLevel] = 4 Then
If MsgBox("Would you like to turn on the bypass key?", vbYesNo, "Allow ByPass") = vbYes Then
CurrentDb.Properties("AllowBypassKey") = True
Else
CurrentDb.Properties("AllowBypassKey") = False
End If
End If
The message box appears even if the AccessLevel is a value other than 4.
Any ideas?
Thanks.