title: Having to call SetFocus twice in MS Access 2010
body: <p>I found that for a couple of hours this code worked:</p>
  
  <pre><code>If KeyCode = 37 Then
  
      Me.Text12.SetFocus
  
  End If
  </code></pre>
  
  <p>Then it mysteriously stopped working.  I thought it might have had something to do with processing the OnEnter subroutine (I move the cursor to the end of the text field).</p>
  
  <p>However editing out the OnEnter subroutine didn't help.
  The only other thing I'd done was change my input/keyboard language (to be able to type quote marks and have them appear immediately, huzzah!)</p>
  
  <p>I now have this code:</p>
  
  <pre><code>On Error Resume Next
  
  If KeyCode = 37 Then
  
      Me.Text12.SetFocus
      Me.Text12.SetFocus
  
  End If
  </code></pre>
  
  <p>Which works.  So I know the 50+ pages of search results for SetFocus not working which relate to it being hidden, disabled, not visible, out for tea with the vicar etc do <strong><em>not</em></strong> apply here.</p>
  
  <p>I've also tried setting the focus to another control first, and liberally applied DoEvents as well, neither of which helped.</p>
  
  <p>Has anyone run into anything similar or is this just a really weird Heisenbug?</p>