title: How to disable record edit but allow using of controls in Access split form?
body: <p>I have a split form with some buttons (cmd) and combo boxes (cbo) at top. The form is based on the table with clients' properties. Question is how to lock records from editing, but allow using cmd and cbo.</p>
  <p>Mostly edit is disabled with <code>me.allowedits = false</code>.
  When <code>.allowedits = false</code>, it is impossible to trigger <code>on_click</code> events, so buttons and combos are not working.</p>
  <p>I have tried a solution using temporary toggle of <code>.allowedits</code> on <code>getFocus/lostFocus</code> events.</p>
  <p>On the first look, it works. On button click we have <code>getFocus-edits</code> enabled first, and can use button or cbo. Any new button triggers lostfocus event first and we have initial locked state.</p>
  <p>But this doesn't always work. If user tries to edit record after using a control, <code>lostFocus</code> is not triggering and editing is still allowed.</p>
  <p>Another popular solution is about locking some controls one by one. This way is quite complicated when there is a lot of fields and buttons.</p>
  <p>Maybe is it possible to dynamically switch form recordset mode from dynaset to snapshot? Or to change something to have button <code>lostfocus</code> event before fields edit? Or maybe there is a better way to lock records but not buttons? Help will be appreciated.</p>
  <p>EDITED after discussion.
  With a help of community, method with changing <code>.RecordsetType</code> was considered as the best. I've tested it, and posted here a code.</p>
  <p>Then I met new restriction. Code works perfect with toggle button.
  But when I use it in form <code>AfterUpdate</code> event, editing of records is still possible, despite the fact, that <code>Me.RecordsetType</code> is set to Snapshot.
  (My wish was to switch off editing mode again after each editing done).</p>
  <p>For now, I have no idea, why <code>Snapshot</code> mode not locking edit when is set in <code>AfterUpdate</code> procedure.</p>
  <p>I have maken a bypass. I figured out, that in Form_Current event, <code>Snapshot</code> works.
  So, bypass code:</p>
  <pre><code>Private Sub Form_AfterUpdate()
   'Bypass for locking edit after change record
   TempVars(&quot;AftUpd&quot;) = True  
  End Sub
  Private Sub Form_Current()
   'Bypass for locking edit after change record 
   If TempVars(&quot;AftUpd&quot;) = True Then
      TempVars.Remove (&quot;AftUpd&quot;)    
      ' release AllowEdit-ToggleButton, and making this button release actions
      tbuAllowEdit.Value = False
      Call tbuAllowEdit_Click
   End If
  End Sub
  </code></pre>
  <p>This works, so I'll stop on this.</p>
  <p>Still, if somebody have thoughts, why <code>Snapshot</code> method is not working in <code>AfterUpdate</code>, or how to fix this, please share.</p>