I have a login form I've created for an Access 2007 database. There are
three controls on the form; a username and password textbox, and a command
button. When a user enters his name and password and then clicks on the
command button I have code that validates the username and password, and if
correct allows the end user access to the database.
I would like the end user to be able to hit the [ENTER] key after typing in
his password and have that keystroke invoke the code for the command button.
In it's current state the end user must tab to the command button and click
it to invoke the login process. This seems like a couple of unnecessary
steps. Can anyone give me direction on how to proceed?
TIA,
Ken Warthen
kenwarthen@gmail.com
Jeff Boyce - 30 Nov 2007 18:30 GMT
Ken
One approach would be to add code to the Exit event of the Password control.
That code would "click" the button.
Regards
Jeff Boyce
Microsoft Office/Access MVP
>I have a login form I've created for an Access 2007 database. There are
> three controls on the form; a username and password textbox, and a command
[quoted text clipped - 16 lines]
> Ken Warthen
> kenwarthen@gmail.com
Ken Warthen - 30 Nov 2007 22:29 GMT
Jeff,
Thanks for the help. I wouldn't have guessed that the Exit event would fire
when the [ENTER] key is pressed, but it works.
Ken
> Ken
>
[quoted text clipped - 26 lines]
> > Ken Warthen
> > kenwarthen@gmail.com
Jeff Boyce - 30 Nov 2007 23:58 GMT
Ken
It works if you have Access set to leave the control when you press <Enter>.
Likewise, it will work if you press <Tab>, or use your mouse to click
elsewhere.
Regards
Jeff Boyce
Microsoft Office/Access MVP
> Jeff,
>
[quoted text clipped - 40 lines]
>> > Ken Warthen
>> > kenwarthen@gmail.com