Hi
I have a class which I use to turn Admin mode on and off. There are in
different areas through access where I enable certain things if admin mode
is on. For example, if Admin Mode is on, then the Client code can be
changed.
I have some of the code below. I'm using an ADP so creating a temp table
isn't suitable.
What I'd like to do is preserve the value of bAdmin_Mode between instances.
I think this involves using Static somehow, but I can't figure out the
syntax.
Any help appreciated
Thanks
Vayse
' Class*************
Private bAdmin_Mode_On As Boolean
Public Property Get Admin_Mode() As Boolean
Admin_Mode = bAdmin_Mode_On
End Property
Private Property Let Admin_Mode(bNewValue As Boolean)
bAdmin_Mode_On = bNewValue
End Property
Public Sub TurnOn(stPass As String)
If Check_Password(stPass) Then
Admin_Mode = True
MsgBox "Admin Mode turned on", vbInformation
Else
MsgBox "Incorrect Password"
End If
End Sub
' Call like this ********************
Dim oAdmin As New clsAdminMode
oAdmin.TurnOn (Nz(Me.txtPassword, ""))