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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|