How to Create Data Entry Forms with Navigation Buttons in Microsoft Access on Windows 11

Posted on 16th June 2023

Introduction

Microsoft Access is a database management system (DBMS) from Microsoft that combines the relational Microsoft Jet Database Engine with a graphical user interface and software-development tools. It is a member of the Microsoft Office suite of applications, included in the Professional and higher editions or sold separately.

Creating Data Entry Forms with Navigation Buttons

  1. In the Navigation Pane, right-click the name of the form to which you want to add navigation buttons, and then click Design View on the shortcut menu.
  2. On the Design tab, in the Controls group, click the button icon.
  3. Click where you want to place the button on the form, and then drag to create a button.
  4. With the button selected, in the Property Sheet, click the Data tab.
  5. In the Control Source box, type an equal sign (=), and then click the name of the macro that you want to run when you click the button.
  6. In the On Click box, click the name of the macro that you want to run when you click the button.
  7. In the Caption box, type the text that you want to appear on the button.
  8. In the Font group, click the font style, size, and color that you want to use for the button text.
  9. Click Run to test the button.

Conclusion

Microsoft Access is a powerful tool for creating data entry forms with navigation buttons. By following the steps above, you can easily create a data entry form with navigation buttons that will make it easy to move around your database.

In the previous article, we saw how to create a basic data entry form in Microsoft Access. In this article, we will add navigation buttons to the form so that we can move between records easily. We will also add a button to add new records.

To add navigation buttons to the form, we need to add a few things to the design of the form. First, we need to add a label to the form. This label will be used to display the current record number. Second, we need to add four buttons to the form. These buttons will be used to move to the first, previous, next, and last record.

To add the label, click on the Label tool in the Toolbox. Then click on the form where you want to add the label. In the Label Properties dialog box, change the Caption property to “Record:”.

To add the buttons, click on the Button tool in the Toolbox. Then click on the form where you want to add the button. In the Button Properties dialog box, change the Caption property to “First”, “Previous”, “Next”, or “Last” for the appropriate button. Then, set the On Click property to [Event Procedure]. This will open the code editor.

In the code editor, we need to add the code for the button click event. For the “First” button, we need to move to the first record in the recordset. We can do this using the MoveFirst method. For the “Previous” button, we need to move to the previous record in the recordset. We can do this using the MovePrevious method. For the “Next” button, we need to move to the next record in the recordset. We can do this using the MoveNext method. For the “Last” button, we need to move to the last record in the recordset. We can do this using the MoveLast method.

We also need to add code to update the label. We can do this by setting theCaption property of the label to the current record number. We can get the current record number using the RecordCount property of the recordset.

The code for the button click event should look like this:

Private Sub FirstButton_Click()

Me.Recordset.MoveFirst

Me.RecordNumberLabel.Caption = Me.Recordset.RecordCount

End Sub

Private Sub PreviousButton_Click()

Me.Recordset.MovePrevious

Me.RecordNumberLabel.Caption = Me.Recordset.RecordCount

End Sub

Private Sub NextButton_Click()

Me.Recordset.MoveNext

Me.RecordNumberLabel.Caption = Me.Recordset.RecordCount

End Sub

Private Sub LastButton_Click()

Me.Recordset.MoveLast

Me.RecordNumberLabel.Caption = Me.Recordset.RecordCount

End Sub

Now that we have added the code for the button click event, we need to test the form. To do this, click on the Form View button in the toolbar. Then click on the First, Previous, Next, or Last button. You should see the record number label update to show the current record number.

Now that we have added navigation buttons to the form, we can move between records easily. In the next article, we will see how to add a new record to the form.

How to Create Data Entry Forms with Navigation Buttons in Microsoft Access on Windows 11

With Microsoft Access, you can create a data entry form that has navigation buttons to help users move from one record to another. You can also add a button that will open a new form for adding records.

To create a data entry form with navigation buttons in Microsoft Access:

1. Open Microsoft Access and click on the “File” tab.

2. Click on “New” and then click on “Blank database”.

3. Enter a name for the database and click on the “Create” button.

4. Click on the “Create” tab and then click on “Form”.

5. Click on the “Form Wizard” icon.

6. Select the table or query that you want to use for the form and click on the “Next” button.

7. Select the fields that you want to include in the form and click on the “Next” button.

8. Select the layout that you want to use for the form and click on the “Next” button.

9. Enter a title for the form and click on the “Finish” button.

10. Click on the “View” tab and then click on “Form View”.

11. Click on the “Design” tab.

12. Click on the “Button” icon.

13. Click on the “Form View” icon.

14. Drag the “Button” icon to the area where you want the button to be located.

15. Enter the text that you want to display on the button.

16. Click on the “Properties” tab.

17. Click on the “Event” tab.

18. Click on the “On Click” event.

19. Click on the “Code Builder” icon.

20. Enter the code that you want the button to execute.

21. Click on the “Run” button.

22. Click on the “Save” button.

23. Close the code window.

24. Click on the “View” tab and then click on “Form View”.

25. Test the button to make sure that it works correctly.