Up Down Keys
By Richard Rost
5 years ago
Use the Keyboard to Move Up and Down Between Records
In this video I'll show you how you can use keyboard shortcuts to navigate up and down through records in your Microsoft Access databases.
Juan from Yokosuka Navy Base, Japan (a Gold Member) asks: I would like to be able to move up and down in my continuous forms just like an Excel spreadsheet using the keys. Is this possible in Access? Right now the up and down arrows just move between fields.
Members
I'll show you how to use the KeyPreview form property to intercept special keys, like the arrow keys. We'll learn about the KeyPress and KeyDown events and the special KeyCode constants. We'll make your form truly behave like an Excel spreadsheet where users can move up, down, left, and right with the arrow keys.
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!
Links
Continuous Forms: https://599cd.com/Continuous
KeyPress Event: https://599cd.com/KeyPress
KeyDown Event: https://599cd.com/KeyDown
Search As You Type: https://599cd.com/SearchAsYouType
Keywords
keypress, keydown, keycode, keypreview, move with arrow keys, acKeyUp, acKeyDown
Subscribe to Up Down Keys
Get notifications when this page is updated
Intro In this video, I will show you how to move up and down between records in a continuous form in Microsoft Access using just the keyboard. We will talk about how the default Tab and arrow key behavior works in continuous forms, demonstrate how to use keyboard shortcuts like Control+Page Up and Control+Page Down to navigate records, and create custom navigation buttons with shortcut keys, making it easier for users to move through records without reaching for the mouse.Transcript Welcome to another TechHelp video brought to you by AccessLearningZone.com. I am your instructor, Richard Rost.
In today's video, I'm going to show you how to move up and down between records in a continuous form using just the keyboard. I'll teach you how you can go up and down records with a single keystroke instead of having to type tab, tab, tab, tab, tab all the way to go through all the fields.
This question comes from Juan at the Yoko Sukah Navy Base, Japan, one of my Gold members. Juan says, "I would like to be able to move up and down in my continuous forms just like an Excel spreadsheet using the keys. Is this possible in Access? Right now, the up and down arrows just move between fields."
Yes, Juan, this is definitely something we can do. I'm going to show you two different options: the simple one, and then a more advanced one in the extended cut.
As always, let's start with a copy of my blank customer template. This is a free download from my website. You can find a link to it in the description below the video.
Here I am at the main menu, and if I open up the customer list, this is a continuous form. If you don't know what a continuous form is, it's where you can see multiple records from your table on the form at the same time. I've got other videos on continuous forms. If you don't know how to make those, go watch that video first.
Now, when you're in a continuous form, the Tab key and the Shift+Tab key move between the fields. There's Tab, there's Shift+Tab. If you want to go up and down through the records though, it's really hard to do. The down arrow acts like the Tab key and the up arrow acts like Shift+Tab.
Now, you can use Control+Page Up and Page Down to move between the records. So Control+Page Down will move between the records like that - up and down - and Control+Page Up. Make sure users might not always remember that. It's sometimes hard to get beginner users especially to remember all these different keyboard shortcuts.
So what you can also do is make little buttons to go between the records down here and assign those with shortcut keys that are sometimes easier to remember. For example, let's go to design view. Let's bring up the design tab, find a command button, and drop it right here. Go to Record Navigation, go to Next Record. For the text, you can put on here "Next," for example.
Now, what we're going to do in the caption is we're going to put a little ampersand in front of that. That makes that a shortcut key. That ampersand N makes Alt+N a shortcut key. Next, give the button a name: NextBTN for next button, and then finish.
I've got a button here that the user can now press Alt+N to move to the next record, and they can see that. Sometimes that's easier for beginners to get used to, and Alt+N is actually kind of easier to find on the keyboard than Control+Page Down.
Let's make another one for previous. So, command button, drop it here, record navigation, go to previous record, we're going to go ampersand PREV for previous, or put the whole word "previous" in there if you want to. PREVBTN, previous button.
Okay, let's put that in front of next. Slide these over here maybe. Okay, let's save that form and close it. Now, open up your customer list. Now you can use these buttons if you want to, or you can go Alt+N or Alt+P. See that? It is visually easier, and sometimes it'll remind the user that you can use those keys instead of having to remember Control+Page Down, which honestly I never do either.
Now, if you want to take people who are used to Excel and actually use the arrow keys to move around, well that involves some programming and we're going to cover that in the extended cut.
In the extended cut for members, I'm going to show you how to use the actual arrow keys to move up and down and left and right in your continuous forms just like an Excel spreadsheet. We'll learn about the Key Press event, the Key Down event, a little bit of programming involved, but not too bad. I'll teach you the key code constants so you know the codes for up and down arrows, for example, and we'll see how to trap form-level key presses.
So here I am in my form again: right, down, down, right, right, down, up, up, left, down - see, just like a spreadsheet. So, fancy keys to remember.
Once again, that's in the extended cut for members. Silver members and up get access to all of my extended cut videos. We are fast approaching 100 extended cut videos, so there's lots of material in there for you.
How do you become a member? Click on the Join button below the video. Silver members and up will get access to all of my extended cut TechHelp videos, live video and chat sessions, and other perks. If 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.
But don't worry, these 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 a continuous form in Microsoft Access? A. A form that displays a single record at a time B. A form that displays multiple records from a table at once C. A form with only one field per record D. A form that shows data in a spreadsheet-like view without allowing edits
Q2. What keys are used by default to move between fields in a continuous form? A. Up and Down Arrow keys B. Tab and Shift+Tab keys C. Left and Right Arrow keys D. Control+Arrow keys
Q3. What do the Up and Down Arrow keys do by default in a continuous form? A. Move between records B. Move between forms C. Act the same as Tab and Shift+Tab keys D. Delete records
Q4. What keyboard shortcut moves between records in a continuous form? A. Alt+N and Alt+P B. Tab and Shift+Tab C. Control+Page Up and Control+Page Down D. Shift+Arrow keys
Q5. To make it easier for users to move between records, what did the video suggest adding to the form? A. Labels with instructions B. Command buttons with assigned shortcut keys C. Navigation bars at the top D. Drop-down menus for navigation
Q6. What does the ampersand (&) do when included in a button's caption? A. It makes the text italic B. It hides the button C. It creates a shortcut key for the button D. It deletes the button
Q7. What shortcut key would you assign to a button with the caption "&Next"? A. Alt+N B. Alt+X C. Control+N D. Shift+N
Q8. What benefit was mentioned about using custom command buttons for navigation? A. They take up less space than keyboard shortcuts B. They are visually easier and remind users about shortcuts C. They lock the current record D. They prevent tabbing between fields
Q9. What advanced topic was promised in the extended cut for members? A. Using the arrow keys to move fields only B. Importing data from Excel C. Programming the arrow keys to move up and down records like in Excel D. Changing form colors with arrow keys
Q10. What types of events were mentioned as important for programming custom keyboard navigation? A. The Mouse Down and Mouse Up events B. The Form Load and Unload events C. The Key Press and Key Down events D. The Double Click event
Answers: 1-B; 2-B; 3-C; 4-C; 5-B; 6-C; 7-A; 8-B; 9-C; 10-C
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 focuses on moving up and down between records in a continuous form in Microsoft Access using just the keyboard. I often get requests from students who want to navigate their forms as efficiently as they do in Excel, where the arrow keys allow you to quickly move from cell to cell. In contrast, Access usually expects you to use the Tab or Shift+Tab keys to move through fields within a record, and by default, the arrow keys also move between fields instead of records.
For example, when working with a continuous form, which displays several records at once, pressing Tab and Shift+Tab will move the cursor through the fields in the current record. The up and down arrows behave like Tab and Shift+Tab rather than moving between records. However, there are keyboard shortcuts built into Access: pressing Control+Page Down moves to the next record, and Control+Page Up moves to the previous one. This works for moving through records, but these shortcuts are not always easy for users—especially beginners—to remember.
To make moving between records even easier, you can add buttons directly to the form. Using the design view, add command buttons for "Next" and "Previous" record navigation. Assign a shortcut key to each button by placing an ampersand before the letter you want as the shortcut in the button's caption, such as "&Next." This way, pressing Alt+N will move the user to the next record, while Alt+P will move to the previous record. For users who prefer a clear, on-screen reminder and a simple shortcut to use, this is a practical solution. Many find Alt+N much easier than Control+Page Down.
But if your goal is to mimic Excel's behavior even more closely by letting users move between records using only the arrow keys, this requires a bit of programming. In today's extended cut, I demonstrate how you can accomplish this with some simple VBA. You'll learn how to use Key Press and Key Down events on the form and work with key code constants to identify when the up and down arrow keys have been pressed. With this programming in place, users can navigate records just like they would in an Excel sheet—using the arrow keys to move up, down, left, and right. I show this process on screen, moving around the form using the arrow keys alone.
For those interested in learning these programming techniques, the extended cut video for members covers all the necessary details, including event handling and trapping key presses at the form level. My Silver members and above already have access to a growing library of extended cut videos where I teach all sorts of advanced Access tricks and techniques.
If you want to become a member, you can find information about membership levels and all the perks that come with them. No matter what, I'll keep making free TechHelp videos for everyone to enjoy as long as you keep watching.
You can 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 keyboard shortcuts to move between records in continuous forms Control+Page Up and Page Down navigation for records Adding navigation command buttons to a form Assigning keyboard shortcuts (Alt+ keys) to buttons Customizing button captions to display shortcut keys Naming navigation buttons for clarity Arranging and positioning navigation buttons on a form Saving and testing navigation shortcuts in a continuous form
|