From the course: Access 2019: Tips, Tricks, and Techniques

Add customized shortcut keys

From the course: Access 2019: Tips, Tricks, and Techniques

Start my 1-month free trial

Add customized shortcut keys

- [Instructor] Power users of any system love having shortcuts to getting their work done. The users of your database will be no exception, and once they've gotten used to the workflows that you've set up for them, they might appreciate even faster and more efficient ways to accomplish common tasks. We can provide multiple ways of accomplishing something in the database by providing power users with keyboard shortcuts that activate button controls. This could make navigating around the database even faster. So let's go ahead and create some keyboard shortcuts for the different buttons here on my main menu. In Access these are implemented with the alt key on your keyboard. You'll type alt and a letter code that corresponds to one of the letters in the name here on the button. Let's switch into design view. And I'll click on this first button that says Enter a New Customer. The shortcut that I like to implement for this button is alt c, c for customer. Let's go ahead and switch into the property sheet, and we'll take a look at the format tab and find the caption property. In order to implement the keyboard shortcut, I'll come right here before the letter c in customer, and I'll type in the ampersand character, which is shift 7 on your keyboard. When I press enter, you'll notice that over here the c gets an underline, that indicates the alt keyboard shortcut. Let's go ahead and do the same thing for the employee directory. This one I'll implement the letter e as a shortcut, so right before that I'll type in the ampersand. And for the product listing we'll implement alt p. Let's go ahead and save the form. I'll press control s on my keyboard, or come up here to the quick access toolbar, and press the save icon, and we'll switch back into form view. Now instead of pressing the button here on the form, what I could do is press alt and then c, should open up the Customer Data Entry form. Now that I'm here, it'd be nice to have a quick easy way to get back. So let's go ahead and switch this into design view, and I'm gonna scroll over to the far right, and find the Return to Main Menu button. I'm gonna make alt m the shortcut key to activate that button. So I'll come over here to Return to Main Menu in the caption, I'll type the ampersand here before m in main. We'll go ahead and save this form, switch back into form view, and now I can press the alt m key to get back to my main menu. Now there's two other ways we can implement shortcut keys on your keyboard, and that's to loop in the enter key and the escape key, in order to activate different buttons. Let's say that I also want the enter key to activate the Enter a New Customer button. To do that, I'll switch back into design view, I'll click on that button, and then we'll go over here to the other tab on the property sheet. The property that we're looking for is this default property. This is the one that links the enter key on your keyboard, to a default option. I'm gonna change that from no to yes. Once again, I'll press control s on my keyboard to save the change, and switch back into form view. Now instead of clicking on the button, or pressing the alt c keyboard shortcut, I could simply press enter, and that jumps me right into the Customer Data Entry form. On this form, I'd like the Return to Main Menu button to also be activated with the escape key on my keyboard. To do that, I'll switch into design view, I'll scroll over, and click on the button, and on the other tab, we'll come down to the cancel property. I'll change that to yes. This is the property that links to the escape key. Once again, I'll save my changes and switch back into form view. And now I can tap the escape key to return back to the main menu. Now we wanna make sure that we're having a consistent interface throughout the entire database, so let's go ahead and go into the other two forms here. I'll switch into design view, and I'm gonna scroll over here to the right. We'll click on the Return to Main Menu button, and I'm gonna change the cancel property on this to yes, and on the format tab I'm gonna put an ampersand here before the m in main menu. I'll save the changes to this form, we'll switch into form view, now I can tap the escape key to get back, we'll click on the product listing, and we'll do the same thing to this button. Now we have a consistent interface throughout the entire program. We'll switch back into form view, I'll type the escape key to get back to the main menu. So that's how we can activate button controls using shortcut keys. Simply place an ampersand character before the letter you want to use on the button's caption, and you're instantly provided a secondary and more efficient way to activate the action. Alternatively, enable the default of cancel properties to make the buttons respond to either the enter or the escape keys on your keyboard.

Contents