I have an Access form with a textbox that is meant to allow for repeatedly typing a number, hitting enter, and letting a script do stuff. For speed, the field should keep t
Try removing the whole line for variable_name.SetFocus and simply add: Cancel = True
variable_name.SetFocus
Cancel = True
Private Sub MyFld_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyReturn Then DoStuff Cancel = True End If End Sub