title: Keep focus on textbox after pressing enter
body: <p>How can I keep the focus in a textbox after pressing enter in a VBA form?</p>
  
  <p>This code adds the text to a Listbox and I want to keep the focus on the textbox to get ready to receive another item.</p>
  
  <p>When I click in the button Add, it adds the text to the Listbox and returns the focus to the textbox, howerver when I press enter it doesn't, even tough it uses the same code. Any suggestion?</p>
  
  <p>This is my code for the textbox:</p>
  
  <pre><code>Private Sub TxtOtherAsset_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  
      If KeyCode = 13 Then
          CmdAddOtherAsset_Click
      End If
  
  End Sub
  </code></pre>
  
  <p>and this is the code for my button:</p>
  
  <pre><code>Private Sub CmdAddOtherAsset_Click()
  
      If TxtOtherAsset.Text &lt;&gt; "" Then
          ListAddedAssets.AddItem TxtOtherAsset.Text
          TxtOtherAsset.Text = ""
      End If
  
      TxtOtherAsset.SetFocus
  
  End Sub
  </code></pre>
  
  <p>I've tried several ways, but I'm not able to return the focus to the textbox. After pressing enter, the focus goes to the next in the TabIndex.</p>