devxlogo

Make a Button Click When the User Presses Enter

Make a Button Click When the User Presses Enter

To make a button click when the user presses enter without the focus on it, simply add this code to the start of your onLoad event on your form:

Command1.Default = True

That would make the button Command1 the default one when the enter key is pressed by the end user.

devx-admin

Share the Post: