title: SendKeys is messing with my NumLock key via VBA code in Access form
body: <p>I have the following code for an Access form. It appears as if the <code>SendKeys</code> is messing with my <KBD>NumLock</KBD> key by toggling it on and off as I open and close the form. </p>
  
  <p>For perfectly valid reasons which I don't want to get into, I really do not want to completely hide the ribbon (I want the pull down menus still accessible) so the <code>DoCmd.ShowToolbar</code> command is not my preferred way of doing it. </p>
  
  <p>Does anyone have any suggestions as to how I can modify the code below to accomplish what I want using the <code>SendKeys</code> command?</p>
  
  <p>Using Access 2007 so the command</p>
  
  <pre><code>CommandBars.ExecuteMso "MinimizeRibbon"
  </code></pre>
  
  <p>is not available to me.</p>
  
  <p>By the way, database will be distributed so solution must be contained within database.</p>
  
  <pre><code>Private Sub Form_Close()
  
  ' Unhide navigation pane
      DoCmd.NavigateTo "acNavigationCategoryObjectType"
      DoCmd.Maximize
  
  ' Maximize the ribbon
  RibbonState = (CommandBars("Ribbon").Controls(1).Height &lt; 75)
  
  Select Case RibbonState
      Case True
          SendKeys "^{F1}", True
      Case False
          'Do nothing, already maximized
  End Select
  End Sub
  
  Private Sub Form_Load()
  ' Hide navigation pane
      DoCmd.NavigateTo "acNavigationCategoryObjectType"
      DoCmd.Minimize
  Debug.Print Application.CommandBars.Item("Ribbon").Height
  ' Minimize ribbon
  RibbonState = (CommandBars("Ribbon").Controls(1).Height &lt; 100)
  
  Select Case RibbonState
      Case True
          'Do nothing, already minimized
      Case False
              SendKeys "^{F1}", False
  End Select
  End Sub
  </code></pre>