title: Triggering an event from enter key
body: <p>I am trying to create a UserForm that has a single data input of one Text box. and several Labels. The user will be scanning barcodes into the text box. The scan will trigger a series of macros to gather data from various sources and output the relevant information through updating the labels.</p>
  
  <p>I have created a similar process in an Excel sheet and use a Change by Val trigger. In this instance, because only the single cell was unlocked the focus stayed on that cell, and hitting enter (or the carriage return from the barcode scanner) updated the cells value and triggered the series of Macros.</p>
  
  <p>In this case I wanted to do the same thing so I expected I could use the AfterUpdate event trigger. The issue I am running into is that because the text box is the only actionable thing on the form the focus never leaves the textbox and therefore doesn't update.</p>
  
  <p>So I changed direction and tried to use a KeyPress event trigger, but it does not seem to work for me. </p>
  
  <pre><code>Private Sub TextBox1_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
      If KeyAscii = 13 Then MsgBox "successful"
  End Sub
  </code></pre>
  
  <p>I have also replaced 13 with vbKeyReturn</p>
  
  <p>As I understand it any time anyone hits Enter while the cursor is active in the textbox there should be a msgbox that says successful pop up. But that is not happening.</p>
  
  <p>I have verified MultipleLine is set to false. I have tried setting EnterKeyBehavior to both True and False without change. </p>
  
  <p>I know in theory I could just make one of the labels an index stop and kick focus back to the text box when it has focus and that would essentially count as an update. Then I could use the update trigger as originally planned. But that seems to be a very sloppy work around and I know I should be able to trigger by the key stroke.</p>