How does one simulate pressing enter in VBA

F

Fred Thomas

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

TIA
 
K

Ken Snell

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

Private Sub ButtonName_GotFocus()
Call ButtonName_Click()
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top