A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to avoid 2585 Error



 
 
Thread Tools Display Modes
  #1  
Old April 9th, 2008, 12:28 AM posted to microsoft.public.access.forms
Manuel
external usenet poster
 
Posts: 46
Default How to avoid 2585 Error

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

  #2  
Old April 9th, 2008, 12:42 AM posted to microsoft.public.access.forms
Dirk Goldgar
external usenet poster
 
Posts: 2,529
Default How to avoid 2585 Error

"Manuel" wrote in message
...
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?


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.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

  #3  
Old April 9th, 2008, 01:13 AM posted to microsoft.public.access.forms
Manuel
external usenet poster
 
Posts: 46
Default How to avoid 2585 Error

Thanks, that worked! I knew there was an easy solution...

"Dirk Goldgar" wrote:

"Manuel" wrote in message
...
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?


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.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:15 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.