toggle button allowEdits

stormin_norm

Registered User.
Local time
Today, 17:35
Joined
Apr 23, 2003
Messages
213
I have a toggle button which is supposed to flip the form from 'view only' to 'edit mode'. Problem is once .Allow* is false then the toggle button is disabled. I had a break point in VB and it never was hit.

I tried pushing the users to click yes/no on an Update Record question (Forms AfterUpdate event), but they love their 'ol view/edit toggle.

Code:
Private Sub ToggleViewEdit_Click()
    If (Me.ToggleViewEdit) Then
        'toggle is pushed in (selected EDIT mode)
        Me.ToggleViewEdit.Caption = "EDIT"
        Me.Form.AllowAdditions = True
        Me.Form.AllowDeletions = True
        Me.Form.AllowEdits = True
    Else
        'toggle is released
        Me.ToggleViewEdit.Caption = "VIEW"
        Me.Form.AllowAdditions = False
        Me.Form.AllowDeletions = False
        Me.Form.AllowEdits = False
    End If
End Sub
 
I believe the if you turn the allow edits to false then you are not able to modify the toggle switch back to allow edits.

Why not use two small command buttons, one to turn edits on and the other to turn the edits off. Update a label to alert the user as to what mode the allow edits is on.
 
Thanks Ghudson, The two button method works.

fyi-I had to put in a Me.Refresh also.
 

Users who are viewing this thread

Back
Top Bottom