Save & Clear Button + Disable Enter

djossh

Registered User.
Local time
Today, 12:55
Joined
Oct 19, 2011
Messages
89
Hi I have one command button in my form. i want my button to

1. SAVE the data upon click of button and CLEAR all fields for new data entry

2. I noticed that when I press the ENTER it will do same action as clicking my button... I tried the "on Enter event" and create a Message Box when Enter is pressed.. it works, but when I press Enter again.... it will proceed with the data transfer... I want to DISABLE the Enter command to transfer the data.. I want the user to use the Button Only to transfer the record...


Please help me with the code.. thanks....
 
Hi I have one command button in my form. i want my button to

1. SAVE the data upon click of button and CLEAR all fields for new data entry
Code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdRecordsGoToNew

2. I noticed that when I press the ENTER it will do same action as clicking my button... I tried the "on Enter event" and create a Message Box when Enter is pressed.. it works, but when I press Enter again.... it will proceed with the data transfer... I want to DISABLE the Enter command to transfer the data.. I want the user to use the Button Only to transfer the record...
When you press the ENTER key when the cursor is where?
 
Code:
DoCmd.RunCommand acCmdSaveRecord
DoCmd.RunCommand acCmdRecordsGoToNew

When you press the ENTER key when the cursor is where?


Thanks for your reply.. after entering data into my fields in the form the cursor will activate the Command Button...since it was the last field in my Tab arrangement....When I press the ENTER the Message box ("Please click on the button to add data") that i created appear.. but when I Press the Enter again.. it will proceed with the transfer of data in my form... I want to avoid that.. I want the user to click on the Button to transfer the data....
 

Users who are viewing this thread

Back
Top Bottom