How does one simulate pressing enter in VBA

  • Thread starter Thread starter Fred Thomas
  • Start date Start date
F

Fred Thomas

Have a button on a form and would like the "GotFocus"
event do the same as pressing the button.

TIA
 
Run the code attached to the button's OnClick event:

Private Sub ButtonName_GotFocus()
Call ButtonName_Click()
End Sub
 
Back
Top