By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,476 Members | 1,529 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,476 IT Pros & Developers. It's quick & easy.

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

P: 1
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:
Expand|Select|Wrap|Line Numbers
  1. Private Sub btn_Edit_Click()
  2.    Me.AllowEdits = True
  3.    Me.btn_Edit.Caption = "Editing"
  4. End Sub
  5.  
  6. Private Sub Form_Current()
  7.    Me.AllowEdits = False
  8.    Me.btn_Edit.Caption = "Edit"
  9. End Sub
Sep 28 '12 #1
Share this Question
Share on Google+
1 Reply


Rabbit
Expert Mod 10K+
P: 12,315
Please use code tags when posting code.

Use the If Then Else syntax to create a toggle.
Sep 28 '12 #2

Post your reply

Sign in to post your reply or Sign up for a free account.