By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,320 Members | 2,239 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,320 IT Pros & Developers. It's quick & easy.

Execute Command Button click event when pressing ENTER in a text box

P: 5
Access 2000
Windows XP

I have a small form with two text boxes:
- User ID
- Password

The form also has two command buttons:
- Login
- Cancel

I would like to set things up so the user can type in his/her ID, click Tab and enter his/her password, then simply press ENTER to login. Right now, when I press ENTER the form sets the focus on the Login button, but I have to press ENTER a second time to execute the click event for that button.

Can this be done?
Mar 25 '08 #1
Share this Question
Share on Google+
1 Reply


missinglinq
Expert 2.5K+
P: 3,532
Sure! In Design View for the form, select the Login Button the goto Properties Sheet - Other and set the Default Property to Yes. Any time the <Enter> key is pressed, no matter where the focus is, the Login Button will fire.

Linq ;0)>
Mar 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.