[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Access 2007 Button Click Event using Enter on KeyBoard

Posted on 2011-10-29
4
Medium Priority
?
516 Views
Last Modified: 2012-05-12
Hi everyone,

I want to have the user have the ability to just select the enter button in lieu of selecting any click button on a form.  Say the user enters a use name on a Login Form and then enters the Password.  I want the user to be able to just click the enter button without having to point the mouse to the LOGIN Button and select.

I remember something about the Key Press Event on this, but have forgot how to do it.  How an this be set in Access 2007 work?

jjc9809
0
Comment
Question by:jjc9809
  • 2
4 Comments
 
LVL 35

Accepted Solution

by:
Norie earned 500 total points
ID: 37051301
Set the Default property to Yes for the button you want to trigger when enter's pressed.

You'll find that on the Other tab of the Property sheet.
0
 
LVL 16

Assisted Solution

by:Sheils
Sheils earned 500 total points
ID: 37051322
You need to set the tab order of the controls on that form so that the username text box gets focus when the form opens. To set the tab order just right click on the form in design view and use the drag and drop dialog box
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 total points
ID: 37051326
* set the Key Preview property of the Form to YES
* use the Form key press event

private sub form_KeyPress(KeyAscii as integer)

if keyascii=acs(chr(13)) then
  ' call the cmdEnter ( the name of your command button ) click event

    cmdEnter_click

end if

end sub
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 1000 total points
ID: 37051327
typo error

* set the Key Preview property of the Form to YES
* use the Form key press event

private sub form_KeyPress(KeyAscii as integer)

if keyascii=asc(chr(13)) then
  ' call the cmdEnter ( the name of your command button ) click event

    cmdEnter_click

end if

end sub
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question