title: MS Access Form locked for edit - Added unlock button but can't add New Record
body: <p>I've got a MS Access form with a sub-form which I want to be read-only for existing records to prevent accidental changes. I've done this by putting simple code on both forms:</p>
  
  <pre><code>Private Sub Form_Current()
  Me.AllowEdits = False
  Me.AllowDeletions = False
  Me.AllowAdditions = False
  End Sub
  </code></pre>
  
  <p>I also added a button that changes the form to allow edits:</p>
  
  <pre><code>Private Sub Command110_Click()
  Me.AllowEdits = True
  Me.AllowDeletions = True
  Me.AllowAdditions = True
  End Sub
  </code></pre>
  
  <p>So I can then edit the form. However I have a button on the parent form to create a new record. I used the standard button function builder "Record Operations -> Add New Record" to create this button. But when I try to use it the error says: Error - You Can't Go To The Specified Record.</p>
  
  <p>So I created a new button with this code:</p>
  
  <pre><code>Private Sub NewClientButton_Click()
  Me.AllowEdits = True
  Me.AllowDeletions = True
  Me.AllowAdditions = True
  DoCmd.GoToRecord , , acNewRec
  End Sub
  </code></pre>
  
  <p>Thinking that would solve it but I still get an error: Runtime Error 2105 You can't Go To Specified Record.</p>
  
  <p>The code on my form in totality looks like this:</p>
  
  <pre><code>Private Sub Command110_Click()
  Me.AllowEdits = True
  Me.AllowDeletions = True
  Me.AllowAdditions = True
  End Sub
  
  Private Sub Form_Current()
  Me.AllowEdits = False
  Me.AllowDeletions = False
  Me.AllowAdditions = False
  End Sub
  
  Private Sub NewClientButton_Click()
  Me.AllowEdits = True
  Me.AllowDeletions = True
  Me.AllowAdditions = True
  DoCmd.GoToRecord , , acNewRec
  End Sub
  </code></pre>
  
  <p>Is it just the ordering of my code subs that is the problem or something else?</p>
  
  <p>Thanks.</p>