Computer Learning Zone CLZ Access Excel Word Windows

Learning is a treasure that will follow its owner everywhere.

-Chinese Proverb
Home   Courses   Seminars   Templates   TechHelp   Fast Tips   Forums   Help   Contact   Join   Order   Logon  
Home > Courses > Access > Templates > ABCD > Part 2 < Part 1 | Part 3 >
ABCD Core Part 2

Back to ABCD Core Part 2

Set Close Button Question Upload Images   Link  
Ramona Woitas 
4 months ago
Part 2 Lesson 2 at 32:13
Is it possible to add code to the Button

- A User Double Clicks on Helper Field + HelperF Opens
- HelperF is already set to go to New Record

? Is it possible to add code, so if User presses the ESC (Escape Key) on the keyboard, it essentially does the same thing as the Set & Close Button?

- Closes HelperF + Sets Helper Combo Field on EntityF to Blank?
Scott Axton
4 months ago
Yes this can be done.  Unfortunately there isn't a super good place to point you for more info.
Searches don't come up with much.    

(Richard - FastTip  material?)

This was covered briefly in the Search Seminar in Lesson 18 and again in Developer 16 Lesson 5.

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
4 months 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
4 months 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 Woitas
4 months 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.
Richard Rost
4 months ago
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. :)

This thread is now closed. If you wish to comment, start a NEW discussion, below.

Back to ABCD Core Part 2 Comments

Start a NEW Conversation
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.

Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
My Account
My Courses
Lost Password
Student Databases
Change Email
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Customer Support
Web Site Tour
Consulting Services
Affiliate Program
Richard Rost
Free Lessons
Mailing List
Video Tutorials
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Terms of Sale
Contact Info
Support Policy
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn