How to turn my "Edit" button into a "Stop Editing" button

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muskrats
    New Member
    • Sep 2012
    • 1

    How to turn my "Edit" button into a "Stop Editing" button

    I have AllowEdits set to False on my form. To avoid unwanted changes in the form I have created a button to allow editing only when it is pressed and it works great.
    Now I'm wondering if there is a way to make my button turn into a Stop Editing button so that people can click it when they are done making changes to the form.

    Code for Edit button:
    Code:
    Private Sub btn_Edit_Click()
       Me.AllowEdits = True
       Me.btn_Edit.Caption = "Editing"
    End Sub
    
    Private Sub Form_Current()
       Me.AllowEdits = False
       Me.btn_Edit.Caption = "Edit"
    End Sub
    Last edited by Rabbit; Sep 28 '12, 09:50 PM. Reason: Please use code tags when posting code.
  • Rabbit
    Recognized Expert MVP
    • Jan 2007
    • 12517

    #2
    Please use code tags when posting code.

    Use the If Then Else syntax to create a toggle.

    Comment

    Working...