Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Button Shortcut Keys > < Open New Record | Requery Subform >
Button Shortcut Keys
By Richard Rost   Richard Rost on LinkedIn Email Richard Rost   4 years ago

Shortcut Key, Default, Cancel Properties for Buttons


 S  M  L  XL  FS  |  Slo  Reg  Fast  2x  |  Bookmark Join Now

In this Microsoft Access tutorial, I'm going to teach you how to push command buttons on your forms using the Default and Cancel properties. I'll also show you how to create your own keyboard shortcut keys and assign them to buttons.

Aaron from Jupiter, Florida (a Platinum Member) asks: I have a form that I'm constantly opening to perform data entry, and then when I'm done, I have to stop, grab the mouse, click a close button, and repeat. It would be great if I could do all of that without having to break my stride on the keyboard to grab the mouse. Can we open and close forms using just keystrokes?

Members

Members are going to learn how to close a form using Ctrl-Enter, which is the standard for website forms today. We'll use some fancy VBA with KeyPreview, KeyDown, KeyCode, and learn about Bitmasks

Silver Members and up get access to view Extended Cut videos, when available. Gold Members can download the files from class plus get access to the Code Vault. If you're not a member, Join Today!

Recommended Courses

Pre-Requisite

Member Links

Learn More

FREE Access Beginner Level 1
FREE Access Quick Start in 30 Minutes
Access Level 2 for just $1

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Diamond Sponsors - Information on our Sponsors
Mailing List - Get emails when new videos released
Consulting - Need help with your database
Tip Jar - Your tips are graciously accepted
Merch Store - Get your swag here!

Questions?

Please feel free to post your questions or comments below or post them in the Forums.

Keywords

access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, shortcut keys, default, cancel, text box, command buttons, contact form, close button, default property, cancel property, enter key behavior, new line in field, default behavior, & shortcut keys, alt-key, keypreview, keydown, acCtrlMask, acShiftMask, acAltMask, KeyCode, Shift, Form_KeyDown, Bit Masks, bitmask, Ctrl-F4 to close a form, ascii values, bitwise AND/OR

 

 

Comments for Button Shortcut Keys
 
Age Subject From
4 yearsNot Using MaskIbrahim Hasouna

 

Start a NEW Conversation
 
Only students may post on this page. Click here for more information on how you can set up an account. If you are a student, please Log On first. Non-students may only post in the Visitor Forum.
 
Subscribe
Subscribe to Button Shortcut Keys
Get notifications when this page is updated
 
Intro In this video, we will learn how to use button shortcut keys in Microsoft Access forms. I'll show you how to set up the default and cancel button properties for opening and closing forms, and how to assign custom keyboard shortcuts to your command buttons to streamline data entry. We'll also talk about using shortcut keys to quickly move to specific fields and discuss the practical uses of these features for improving workflow without needing to use the mouse.
Transcript Welcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.

In today's video, we're going to learn about button shortcut keys. I'm going to first teach you how to use the default and cancel properties to open and close a form. Then I'm going to teach you how to assign custom shortcut keys to buttons to push those as well.

This is great for people who do a lot of data entry and don't want to have to stop and grab the mouse to click on buttons.

Today's question comes from Aaron in Jupiter, Florida, not too far from me. Aaron says: I have a form that I'm constantly opening to perform data entry, and then when I'm done I have to stop, grab the mouse, click a close button, and repeat. It would be great if I could do all of that without having to break my stride on the keyboard to grab the mouse. Can we open and close forms using just keystrokes?

Well, yes, of course, Aaron, you can. Let me show you a couple of options.

Here I am in my TechHelp free template. This is a free database. You can download a copy from my website if you want a copy. If you want to learn how I built it, go watch this video. It's free. It's on my website. It's on my YouTube channel. There's a link right there. I'll put a link down below you can click on as well.

Let's go into the customer form and then to the contact form. It is really tight, but all the information about each contact is with that customer. Let's say you do a lot of data entry and a lot of typing into this form, so let's adjust it a little bit.

Come in here and let's make this bigger. I'm going to just move Follow Up out of the way up here, maybe take that label and put it up top with a little cut and paste. We'll slide that over here like that.

Now let's get this Customer ID out of here. I'm going to put it up there. It's red because it's hidden, which I covered in that video. Then we're going to take this field here and make it nice and big. Let's say we do a lot of typing, a lot of data entry in this field right there. Look at that - nice and big.

I'm going to save that. Then I'll just close this and open it back up so you can see what we're dealing with.

I want to come down here now and type in a whole bunch of notes. Type in a bunch of notes, type in a bunch of notes, type in a bunch of notes. When I'm done, without having to stop and grab the mouse, I just want to move on to the next record, or I want to close this and go back to the customer form.

Right now, if you know the keyboard shortcut, Control+F4, that will close a form. That's a training issue. You could put a note right down here on the bottom: "Press Control+F4 to close." But that's not very elegant.

Let's add some buttons to do this stuff too. Right-click, Design View. Let's put a button down here to close this form. Grab the command button off the toolbar, drop it right there. Now, I tend to avoid the wizards, but for this one, it's the simple wizard, so we'll just use that. More operations, close a form. Next. I want to put the words "Close Form" on there. Next, let's give it a good name, CloseButton maybe.

There we go. There's our Close Form button. Save that. I'll close it, open it back up again, and now I've got a simple button that closes the form.

Very simple, straightforward stuff. Nothing new yet.

Now, there are some properties that you can assign to these buttons. Go to the Other tab over here. You'll see Default and Cancel. Default, if you assign this as the default button, that means when you press Enter, it's going to click that button. Cancel means if you hit Escape on your keyboard, it's going to press that button.

Let's make this the default button. I'll hit Yes. Save it, close it, open it up again.

Now watch. If I press Enter on my keyboard, it closes the form. That's good for any form where you've got normal text boxes here; however, that doesn't work if you're down here in a long text box, because if you type and you press Enter, it goes to the next line. Enter goes to the next line, so that actually overrides the button.

Now you could change the properties of this text box. Design View, go to here. There's "Enter Key Behavior," which says "New Line in Field." If you drop that down, you could say Default, which is how the short text boxes work. Default means if you press Enter, it's going to move to the next record, like it does back here. If I'm sitting on "Richard" and I press Enter, it goes to the next one. That's the default behavior. If Access sees that's the long text, it switches it. That will work. Save changes, yes, come back over here.

If I'm in here now and I press Enter, it pushes the button. But most of the time when you're using long text, you want to be able to press Enter in here. Now you have to teach your users to press Control+Enter to get a new line, and again, that's counterintuitive. So we're not going to use that option. That's good for some forms like this one. As long as you're not in the notes field, you can press Enter for a default button to close the form or push whatever button you want.

Let's go back into the properties. Go to this guy here. Let's put the Enter Key Behavior back to "New Line in Field." This time, let's try the Escape key. Let's try the Cancel option. I'm going to turn Default off and let's set Cancel to Yes. Now that's going to tie this button to the Escape key. Let's see what happens now. Save that, close it, open it back up again.

Let me type in some new stuff. This is some new stuff. Let me hit the Escape key. Great, it pushed the button. So it worked just fine.

Let's go back in there. Wait a minute - all my old text is in there. Why is that? When you cancel with the Escape key, it doesn't save the record that you're editing. Be careful of that. That's a good way to pop something up, and then if the user doesn't want to save the changes, they can hit Cancel. They can hit the Escape key and it cancels that data entry.

So that's not a good option for this either. You can put a cancel button down here if you want to. Design View, do the same thing. In fact, I'll just copy this button. Watch this: Copy, paste, Control+C, Control+V, come over here. I'll put in "Cancel" like that. We'll call this the Cancel button. Set a command 9. Cancel button. Go to Other and we'll leave Cancel set to Yes on that guy.

You can only have one Cancel and one Default button on your form, by the way. If you come over here, this guy's not going to turn off.

This is the Cancel button, which you might want to leave there for your users. If I'm coming in here and I'm typing blah, blah, blah and I don't want to save that, hit Cancel, boom, it doesn't save the record. So that button has its purposes.

For this form, neither Enter/default nor Cancel is going to work to do what we want to do. So we're going to assign a custom shortcut key.

Click Design View. The way you do that is by looking at the caption of the button. Where is the Caption property? Right here. Caption property. It's "Close Form" right now. What we're going to do is put an ampersand in front of whatever character we want to make the shortcut key. So I'll go "&Close Form." Now if you look over here, there's a little underline underneath the C in the "Close" button.

Let me zoom in for you so you can see better. Did an ampersand before "Close" and now we have a little underscore under that C. That's my shortcut key. That means you press Alt and that letter to push that button.

Save it now. Close it. Open it back up again. I'm in here, typing, typing, typing, typing, typing. Now, Alt+C closes the form.

I can go back in by pressing Spacebar, because notice my focus is still on that button. It's a little tiny dotted line around it. That tells you that button still has the focus. That's where the cursor is basically sitting. Hit Spacebar to push that button. It opened up, and look, it saved my changes. Press Alt+C.

Do you have to put the ampersand in front of the first character? No, you can use any character in there, but you can only have one character mapped per form. You couldn't do Alt+C in front of Cancel either. But you could do like, let's say Alt+F for this one. "Close &Form" like that. Now you have the ampersand in front of the F, so that's your hotkey. This guy could be "&Cancel" like that. So Alt+A closes that one. Save it. Close it. In Contacts, come in here and go Alt+A to push the Cancel button. If I go Alt+F, push the Close Form.

If you hold down the Alt key long enough, these little Alt helpers for the ribbon pop up. Just don't hold the Alt key down that long.

You can also use this trick to jump to fields inside a form, just to jump to a text box. Let's say, for example, that you're constantly jumping to the email address. Watch this. Come in here, Design View. The label - notice this label is attached to that text box. In fact, if you click on the field here, you'll see the label name is Label23, which is that guy. They're linked together.

If you have a label that's not linked to it, there's a little shortcut for you. Let me cut that off. I just hit Control+X and I pasted it. Now I have an independent label. The little green icon tells you here that it's independent. To associate this label with a control, you can associate it with email that way.

Another way to do it is to simply cut it, click on that field, and then paste it. That's the old school trick. Now it's re-associated again. Anyway, that was a little tangent for you.

What you can do is, let's say you want to make this a shortcut key. Come in here in front of the E and go "&Email." Now look at that. You get the little underscore there. Save that. Close it. Close that. Come back in here. Now, no matter where you are on this form, if you want to jump to the email field, just go Alt+E. There you go - a little shortcut trick.

If you want to make these buttons have shortcuts, you have C and O. Now you can jump all around your form with that. You can go Alt+E to go to email, Alt+C to open up contacts, Escape to cancel that, Alt+O to open up orders. If you don't have any buttons on here, remember Control+F4 closes that. Don't mix that up with Alt+F4, by the way. Alt+F4 shuts down the whole application, so it will shut down Access altogether.

The trend today on web forms, on forms on web pages, is to use Control+Enter to submit. YouTube uses it. A lot of other sites use it. So you're done typing in your data, you press Control+Enter to submit your form.

I'm going to show you how to do that in the extended cut for the members. It's not as simple as just setting up an Alt key shortcut. We actually have to get into Key Preview, the Key Down event, learn what key codes are, and a little bit about bit masks. That's cool stuff. What you'll be able to do is, at the end of typing in your stuff, you'll be able to hit Control+Enter and it'll push that close form button. That's covered in the extended cut for the members.

Silver members and up get access to all of my extended cut videos. There are about 300 of them now. You get some free classes with that too. You get a free class every month. Gold members can download these databases.

What are you waiting for? It costs about the price of a cup of coffee to join. Join today, and you'll get my eternal gratitude as well. I have puppies to feed, so I need more members. The more members I get, the more cool videos I make. Come on, join the party.

That is your TechHelp video for today. I hope you learned something and we'll see you next time.

How do you become a member? Click on the Join button below the video. After you click the Join button, you'll see a list of all the different membership levels that are available, each with its own special perks.

Silver members and up will get access to all of my extended cut TechHelp videos, one free beginner class each month, and more. Gold members get access to download all of the sample databases that I build in my TechHelp videos, plus my code vault where I keep tons of different functions that I use. You'll also get a higher priority if you decide to submit any TechHelp questions to me. Get one free expert class each month after you finish the beginner series.

Platinum members get all the previous perks, plus even higher priority for TechHelp questions, access to all of my full beginner courses for every subject, and one free developer class each month after you finish the expert classes. These are the full-length courses found on my website, not just for Access. I also teach Word, Excel, Visual Basic, and more.

You can now become a Diamond sponsor and have your name or company name listed on a sponsors page that will be shown in each video as long as you are a sponsor. You'll get a shout out in the video and a link to your website or product in the text below the video and on my website.

Don't worry, these free TechHelp videos are going to keep coming. As long as you keep watching them, I'll keep making more, and they'll always be free.
Quiz Q1. What is the main benefit of assigning shortcut keys to buttons in Access forms?
A. It allows users to format text within the form
B. It enables users to perform actions without using the mouse
C. It lets users print forms directly
D. It automatically schedules backups for forms

Q2. Which property should be assigned to a button to allow the Enter key to activate it?
A. Visible
B. Default
C. Enabled
D. Cancel

Q3. What is the function of the Cancel property on a button in an Access form?
A. It saves the record
B. It resets all form fields to blank
C. It ties the Escape key to that button
D. It opens a new record

Q4. What is a limitation when using the Default or Cancel property for buttons in forms with long text fields?
A. They do not work with number fields
B. Enter and Escape keys may override expected text box behavior
C. They are only enabled for admin users
D. They require use of VBA code first

Q5. How do you assign a custom shortcut key to a button in Access?
A. Prefix the Caption property with a colon (:)
B. Add a percentage sign (%) before the Caption
C. Use an asterisk (*) before the Caption
D. Place an ampersand (&) before the desired letter in the Caption property

Q6. If you want the Alt+F key combination to be the shortcut for closing a form, how should you set the button Caption property?
A. "Close Form"
B. "&Close Form"
C. "Close &Form"
D. "&F Close"

Q7. How many Default and Cancel buttons can you have on a single form?
A. As many as you want
B. One of each
C. Only Default, not Cancel
D. None

Q8. What does the presence of a small underline beneath a letter in a button's caption indicate?
A. The button is hidden
B. The button uses that letter as a shortcut with Alt
C. The button is disabled
D. The button will print the form

Q9. According to the video, which key combination closes a form in Access by default (without custom programming)?
A. Alt+F4
B. Alt+C
C. Control+F4
D. Shift+F4

Q10. What is likely to happen if you hold the Alt key too long when using custom shortcut keys in Access?
A. Access will close the database
B. The Alt helpers for the ribbon will appear
C. The system will freeze
D. It submits the form automatically

Q11. What is a useful shortcut trick to quickly move to a specific field, like "Email," within a form?
A. Add an ampersand before a letter in its label caption and use Alt+<letter>
B. Set that field as the default control
C. Mark it as the primary field in table design
D. Only use a button, not the label

Q12. Why might you avoid reassigning the Enter key to close a form when working with long text fields?
A. Because Enter is used to move to the next record by default
B. Because Enter is used for printing in long text fields
C. Because Enter inserts a new line, overriding the button's behavior
D. Because Enter only works in short text fields

Q13. What is a modern shortcut key combination, as mentioned in the video, often used on web forms for submitting data?
A. Shift+S
B. Alt+C
C. Control+Enter
D. Control+S

Q14. How can you re-link an independent label to a field in Access?
A. Set the label's tag property
B. Paste the label onto the field in Design View
C. Assign both the same name
D. Use the format painter tool

Answers: 1-B; 2-B; 3-C; 4-B; 5-D; 6-C; 7-B; 8-B; 9-C; 10-B; 11-A; 12-C; 13-C; 14-B

DISCLAIMER: Quiz questions are AI generated. If you find any that are wrong, don't make sense, or aren't related to the video topic at hand, then please post a comment and let me know. Thanks.
Summary Today's video from Access Learning Zone covers how to use button shortcut keys in Microsoft Access forms. I will explain how you can streamline your workflow by assigning keyboard shortcuts to open and close forms efficiently, which is particularly useful if you handle a lot of data entry and want to avoid reaching for the mouse repeatedly.

The topic for today comes from a viewer who is often opening a data entry form, typing information, and then having to interrupt the flow by grabbing the mouse to click the close button each time. The goal here is to see if we can use just the keyboard for these actions.

To start, I'll demonstrate using the default TechHelp free template, which you can also download and follow along with if you'd like. Inside the sample database, I'll focus on adjusting a customer contact form. Imagine you're spending most of your time typing into a large notes field on this form. For improved visibility, I make this text box larger and rearrange some of the fields so the layout better suits heavy data entry tasks.

Once you've prepared your form, the challenge is to efficiently navigate and close the form without constant mouse use. While Access does have a built-in shortcut like Control+F4 for closing a form, relying on users to remember this is not ideal. It's better to add buttons for these actions. By placing a Close Form button on the form, I can give users an obvious action to take.

After creating the button, it's important to look at its properties. Access lets you set buttons as either the Default or the Cancel button for a form. If a button is set as Default, pressing Enter will activate it, provided the cursor is not in a long text field, because pressing Enter there simply adds a new line. Alternatively, setting a button as Cancel means pressing Escape will activate it. However, using Escape to close the form does not save unsaved data and can result in loss of data entered in the current record, so this option may not suit every scenario.

If neither the Default nor the Cancel setting is a perfect fit, the next step is to add a custom keyboard shortcut by editing the button's caption property. Placing an ampersand character before a letter in the caption (for example, "&Close Form") will underline that letter and turn it into a hotkey. Now, pressing Alt along with the underlined letter (like Alt+C) activates the button, regardless of where you are in the form.

This method works for more than just buttons. You can also assign keyboard shortcuts to jump directly to specific fields, like an email address text box. If you add an ampersand to a field's label (such as "&Email"), pressing Alt+E will move the cursor there. This kind of customization greatly speeds up navigation and is easy to repeat for other controls.

Typically, you'll only want one Default and one Cancel button per form. You can assign unique shortcut keys to various buttons or text boxes, but you cannot have duplicate shortcuts on the same form.

As a side note, remember that holding the Alt key for too long will bring up the ribbon shortcuts in Access, so quick taps work best. These techniques offer a significant boost to productivity, particularly for users who prefer to keep their hands on the keyboard.

It's also important to distinguish between Access's built-in shortcuts. For example, Control+F4 closes the current form, but Alt+F4 exits all of Access completely. You might also find that some web forms have adopted Control+Enter as a shortcut for submission. Implementing that kind of functionality in Access forms requires additional techniques, such as handling Key Preview and working with key events.

In today's Extended Cut, I cover exactly how to enable the Control+Enter shortcut to close a form, as is common in many web applications. We will explore how to use properties like Key Preview and handle the Key Down event. This approach involves working with key codes, as well as concepts like bit masks. By setting this up, you can allow users to simply press Control+Enter to submit their data and close the form without any extra steps.

Members at the Silver level and above get access to all extended cut videos, bonus beginner classes every month, and more. Gold members can also download all of my sample databases and access specialized functions in the code vault, as well as priority on TechHelp questions. Platinum members get even more, including all full beginner courses for every application I teach, classes in Access, Word, Excel, Visual Basic, and a monthly developer class after mastering expert material.

To become a member, look below the video for the Join button, which outlines every membership level and its associated perks. Supporting memberships help me produce more tutorials like this and keep these free videos coming to everyone.

You will find a complete video tutorial with step-by-step instructions on everything discussed here on my website at the link below. Live long and prosper, my friends.
Topic List Using Default and Cancel button properties in forms
Assigning the Default property for Enter key functionality
Assigning the Cancel property for Escape key functionality
Effect of Default and Cancel properties on data entry fields
Changing Enter Key Behavior property in text boxes
Limitations of default keyboard shortcuts with long text fields
Creating custom button keyboard shortcuts using ampersand
Assigning shortcut keys to buttons with the Caption property
Demonstrating Alt+Key navigation for form buttons
Using shortcut keys to move focus to specific text fields
Associating and re-associating labels with form controls
Keyboard navigation tips for closing forms and switching fields
Practical keyboard shortcuts for data entry efficiency in Access
 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 1/15/2026 3:31:13 PM. PLT: 1s
Keywords: TechHelp Access shortcut keys, default, cancel, alt key, acCtrlMask, acShiftMask, acAltMask, KeyCode, Shift, Form_KeyDown, Bit Masks, bitmask, Ctrl-F4 to close a form, ascii values, bitwise AND/OR  PermaLink  Button Shortcut Keys in Microsoft Access