Randomblink
The Irreverent Reverend
- Local time
- Today, 07:59
- Joined
- Jul 23, 2001
- Messages
- 279
Ok...
The following code is supposed to be locked to a button...
When the button is clicked it is supposed to lock or unlock the form...this way the user opens the form and it is locked, then they have to unlock it to make changes...
When it is unlocked they can make changes...
The button doesn't do anything...
What am I doing wrong...???
FYI: The button is actually a label_field that has an On_Click event.
Private Sub btn_keymaster_Click()
' lock and unlock the form for editing with this button
Select Case KEY
Case "Locked"
Unlock_Key
Case "Unlocked"
Lock_Key
Case Else
KEY = "Locked"
End Select
End Sub
Private Sub Lock_Key()
Form_frm_Class_Mailing_List.AllowAdditions = False
Form_frm_Class_Mailing_List.AllowDeletions = False
Form_frm_Class_Mailing_List.AllowEdits = False
Let KEY = "Locked"
lbl_LOCKED.Visible = True
lbl_Unlocked.Visible = False
End Sub
Private Sub Unlock_Key()
Form_frm_Class_Mailing_List.AllowAdditions = True
Form_frm_Class_Mailing_List.AllowDeletions = True
Form_frm_Class_Mailing_List.AllowEdits = True
Let KEY = "Unlocked"
lbl_LOCKED.Visible = False
lbl_Unlocked.Visible = True
End Sub
Then I have the form do this...
Private Sub Form_Open(Cancel As Integer)
Dim KEY As String
KEY = "Locked"
End Sub
HELP!
Argh!
This was supposed to be a quick easy help-out for a friend and now I can't proceed until I get this fixed or I will go nuts...
The following code is supposed to be locked to a button...
When the button is clicked it is supposed to lock or unlock the form...this way the user opens the form and it is locked, then they have to unlock it to make changes...
When it is unlocked they can make changes...
The button doesn't do anything...
What am I doing wrong...???
FYI: The button is actually a label_field that has an On_Click event.
Private Sub btn_keymaster_Click()
' lock and unlock the form for editing with this button
Select Case KEY
Case "Locked"
Unlock_Key
Case "Unlocked"
Lock_Key
Case Else
KEY = "Locked"
End Select
End Sub
Private Sub Lock_Key()
Form_frm_Class_Mailing_List.AllowAdditions = False
Form_frm_Class_Mailing_List.AllowDeletions = False
Form_frm_Class_Mailing_List.AllowEdits = False
Let KEY = "Locked"
lbl_LOCKED.Visible = True
lbl_Unlocked.Visible = False
End Sub
Private Sub Unlock_Key()
Form_frm_Class_Mailing_List.AllowAdditions = True
Form_frm_Class_Mailing_List.AllowDeletions = True
Form_frm_Class_Mailing_List.AllowEdits = True
Let KEY = "Unlocked"
lbl_LOCKED.Visible = False
lbl_Unlocked.Visible = True
End Sub
Then I have the form do this...
Private Sub Form_Open(Cancel As Integer)
Dim KEY As String
KEY = "Locked"
End Sub
HELP!
Argh!
This was supposed to be a quick easy help-out for a friend and now I can't proceed until I get this fixed or I will go nuts...