Datasheet
Designing Applications
35
We've now made the first three changes we decided on, and our form certainly looks a little
more professional. But what about the other change? We still need to put more manageable
navigation buttons on the screen. This is where things get a little more advanced!
Creating Navigation Buttons
To make the form easier to use, we can place some command buttons on the screen to replace
the present navigation buttons. We can then use macros to move through the records behind
the form. A macro is simply a stored collection of instructions that correspond to the actions
that a user might carry out. So, in this case, our macro would contain the instructions to move
to the next, previous, first or last records.
Of course, this book is about VBA, not macros. However, using them here will help show you
their limitations.
Try It Out Adding Simple Navigation Buttons to a Form
1. Switch back to Design View. We're going to use headers and footers, so go to the View
menu and select the Form Header/Footer option. A header section and footer section
will then appear on the form. We don't have to add the buttons to the footer of the
form. We could add them onto the Detail section of the form instead. However, putting
them on the footer keeps them in one place and we don't have to worry about them
getting in the way if we decide to change around the other controls in the Detail section:
2. Next, we must remove the navigation buttons that Access supplies by default. So, click
the Form Selector to bring up the form's property sheet, and on the property sheet's
Format tab, change the value of the Navigation Buttons property from Yes to No. You
can do this by double-clicking the property value or by clicking on the arrow and
selecting No from the drop-down list that appears: