Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / May 2008

Tip: Looking for answers? Try searching our database.

Run command on enter push

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ryan Tisserand - 09 May 2008 14:57 GMT
I dont know if im not looking in the correct areas, but I cant seem to find
the answer to my question.  All I want is to run a command when the enter key
on the keyboard is pushed.  I have a form with two fields and a button.  User
name, and password are the fields.  Login is the button.  I would like the
login button event to happen if the user pushes enter on the keyboard while
on the password field.  Is this possible?
Mr B - 09 May 2008 15:15 GMT
Ryan,

First I would suggest that you make sure that you have set the Tab Order for
the controls on your form.  This will insure that your users are navigating
throught the options on your form in the way that you want them to.  Doing
this may solve your issue altogether because when the user enters their User
Name and presses the enter key they will be moved to the Password field.  
Like wise when they have entered their password and pressed the enter key,
the focus would be passed to the Login button and user could just press the
Enter key again and the code assigned to the OnClick event of the Login
button would be run.

Now, to answer your question;  I assume that want you are wanting to do is
to fix your form so that the user does not have to click the Login button
with the mouse because pressing the enter key is actully an indication to any
control that you have finished your entry into that control.  You can set the
Login button to be the default button by setting the Default property of the
Login button to Yes.  However, be aware that this is really designed to be
used when you have multiple buttons on one form.

Signature

HTH

Mr B
askdoctoraccess dot com

> I dont know if im not looking in the correct areas, but I cant seem to find
> the answer to my question.  All I want is to run a command when the enter key
> on the keyboard is pushed.  I have a form with two fields and a button.  User
> name, and password are the fields.  Login is the button.  I would like the
> login button event to happen if the user pushes enter on the keyboard while
> on the password field.  Is this possible?
Ryan Tisserand - 09 May 2008 15:24 GMT
Thank you for your quick response.  This did solve my issue.  I knew it
should be something easy and I have been racking my brain for a week on this
one.  I have at least 150 forms to go back and add this to beacuse everyone
complains that they have to hit enter 2 times to do anything.

> Ryan,
>
[quoted text clipped - 22 lines]
> > login button event to happen if the user pushes enter on the keyboard while
> > on the password field.  Is this possible?
Mr B - 09 May 2008 18:40 GMT
Glad to help.  That is what this community is all about.  I've used it many,
many times and really don't know what I would have done without it.

Good luck with your projects.

Mr B
askdoctoraccess dot com

> Thank you for your quick response.  This did solve my issue.  I knew it
> should be something easy and I have been racking my brain for a week on this
[quoted text clipped - 27 lines]
> > > login button event to happen if the user pushes enter on the keyboard while
> > > on the password field.  Is this possible?

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.