M
Mark A. Sam
Sometimes, not always I get this error when on this line in my Current Event
of a main form....
[PickUps].Form![ViewLogChanges].Visible = Nz((GetUserLevel() = "Admin"),
False)
Runtime error '2455': You entered an expression which has an invalid
reference to the property Form/Report.
[Pickups] is a subform
[ViewLogChanges] is a command button on the subform
Nz((GetUserLevel() = "Admin"), False) = True
GetUserLevel = "Admin"
GetUserLevel can return a string, "User" or "Admin" or the value Null. Then
GetUserLevel = Null the problem doesn't seem to occur. It seems to occur
when GetUserLevel is Not Null.
Here is GetUserLevel
Public Function GetUserLevel()
If RequireLogin = False Then
GetUserLevel = "Admin"
Else
GetUserLevel = Nz(DLookup("[level]", "loginUsers", "[UserName] = '" &
pubLoggedUser & "'"), Null)
End If
End Function
Thanks for any help.
God Bless,
Mark A. Sam
of a main form....
[PickUps].Form![ViewLogChanges].Visible = Nz((GetUserLevel() = "Admin"),
False)
Runtime error '2455': You entered an expression which has an invalid
reference to the property Form/Report.
[Pickups] is a subform
[ViewLogChanges] is a command button on the subform
Nz((GetUserLevel() = "Admin"), False) = True
GetUserLevel = "Admin"
GetUserLevel can return a string, "User" or "Admin" or the value Null. Then
GetUserLevel = Null the problem doesn't seem to occur. It seems to occur
when GetUserLevel is Not Null.
Here is GetUserLevel
Public Function GetUserLevel()
If RequireLogin = False Then
GetUserLevel = "Admin"
Else
GetUserLevel = Nz(DLookup("[level]", "loginUsers", "[UserName] = '" &
pubLoggedUser & "'"), Null)
End If
End Function
Thanks for any help.
God Bless,
Mark A. Sam