Previously in the article Open Form When Database is Opened, Access I’ve explained how you can cause a form to appear every time the an Access file is opened. By default the form will be displaying the first record in the table:
In this article I will explain how you can cause a blank form to appear rather than a form with data from the first record.
Open the form in design view:
Click on the View Code button on the Design ribbon:
The following window will open:
If no previous macros have been written you will only see one class in the project explorer on the left:
If there are multiple classes on the left click on the forms class. It will have a name in the format:
where “FormName” is the name of the form, which in our case is “Form1”.
Write the following code inside the Form_Form1 class:
Private Sub Form_Load()
Call DoCmd.GoToRecord(, , acNewRec)
Whenever the Access file is opened, a blank form will appear ready to input a new record:
You can download the sample file and code used in this article from the link below:
If you need assistance with your code, or you are looking for a VBA programmer to hire feel free to contact me. Also please visit my website www.software-solutions-online.com