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 / Forms / April 2008

Tip: Looking for answers? Try searching our database.

How to avoid 2585 Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Manuel - 09 Apr 2008 00:28 GMT
This seems like it would be easy to do but I can't figure it out...

I have a login form where the user selects his/her User ID and enters a
password.  The user then selects a command button to sign in.  The command
button runs through some code which checks the password and then closes the
Sign In form and opens another form if the password is correct.  What I want
to do is have the command button code run when the user hits the ENTER key on
his/her keyboard (this would provide the user with two options for logging
into the database: select the Sign In command button, or simply press ENTER
on the keyboard).

The problem is that I can't seem to accomplish this seemingly easy task
without triggering the 2585 run-time error.  What I've done is called the
code from the ENTER event of the next tab control. Apparently Access doesn't
like the fact that I'm trying to close a form on the "ENTER" event of this
control.

Any suggestions for how to circumvent this error?  Is there a better way to
do this?

Thanks,
Manuel
Dirk Goldgar - 09 Apr 2008 00:42 GMT
> This seems like it would be easy to do but I can't figure it out...
>
[quoted text clipped - 21 lines]
> to
> do this?

Have you tried just setting the command button's "Default" property (on the
Other tab of the control's property sheet), to make it the form's Default
button?  If you do that, then any time the user presses Enter on the form,
the button's Click event should fire.

Signature

Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

Manuel - 09 Apr 2008 01:13 GMT
Thanks, that worked!  I knew there was an easy solution...

> > This seems like it would be easy to do but I can't figure it out...
> >
[quoted text clipped - 26 lines]
> button?  If you do that, then any time the user presses Enter on the form,
> the button's Click event should fire.
 
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.