If you go into the properties for a Button on a form under the Other tab you will see two options Default and Cancel.
Default tells Access that that is the button to "press" when you type enter on the form. Cancel tells Access the button to "press" when you hit ESCape on the form. Those options are either yes or no - and the same button can't be both Default and Cancel - One option per button.
What ever actions you have programed for that button will be performed just as though you clicked it with a mouse.
Scott Axton 3 years ago
Another cool trick that is relatively undocumented is you can place an & before a letter and turn that in to a key combination to "press" the button"
For example the caption for that button is "Set & Close" in the Core 2 video you mentioned. If you type in the caption properties "&Set & Close" when you go back to form view it will look like this: Set & Close.
Now in the form if you Press the key combination "Alt-S" that will act as though you pressed the button with the mouse as well.
Scott Axton 3 years ago
I should mention that that can be kind of dangerous. If users are used to typing enter to move to the next field they would press the xxx button instead.
Pressing ESC could have the same unintended consequences. Instead of undoing your typing ESC would press your yyy button and possibly introduce unintended results in your program flow.
Ramona WoitasOP 3 years ago
Thanks for the information Scott. I think I will leave well enough alone, so it doesn't screw up something later. Or at the very least, wait till Part 6 is completed, and then maybe revisit.
Yeah, I would just assign a Cancel button if that's what you want to do. Is [THING] possible in Access? Probably. Should you do [THING] even though you can? That's the question. :)
Sorry, only students may add comments.
Click here for more
information on how you can set up an account.
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
ABCD Core Part 2.
The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.