How to Open a Blank Access Form from a New Datasheet Row
Question details
The user wants to open a blank data entry form by clicking a hyperlink in the new-record row of an Access subform datasheet, rather than having it navigate to the first existing record.

- Product
- Microsoft Access
- Device & OS
- not provided
- Scenario
- Clicking a hyperlink within a new datasheet row in a Microsoft Access subform to insert new data.
- Observed behavior
- The hyperlink incorrectly opens the first existing record instead of launching a blank detail form.
Ensure you have basic familiarity with Microsoft Access VBA (Visual Basic for Applications) and have created a backup copy of your database before modifying form events and VBA code.
Use an If IsNull Condition with acFormAdd
Check if the current record ID is null to determine if the user is in a new row, and then force the target form to open in data entry mode.
When clicking a hyperlink on a new record row, the system does not pass a valid ID by default, causing Access to simply open the first available record. By utilizing a VBA condition, you can instruct the form to open a blank record specifically when no ID is present.
Right-click your subform in the navigation pane and select 'Design View'.
Select the hyperlink control in the datasheet, open the Property Sheet (F4), and navigate to the 'Event' tab.
Locate the 'On Click' event, select [Event Procedure] from the dropdown, and click the ellipsis (...) button to open the VBA Editor.
Enter the condition 'If IsNull(Me.YourIDControlName) Then' to check if the current row is a new, unsaved record.
Inside the If block, type 'DoCmd.OpenForm "YourDetailFormName", , , , acFormAdd, acDialog' to open the detail form in Add mode.
Add an 'Else' statement to handle standard hyperlink clicks (opening existing records). After the If block, include a 'Me.Requery' command to refresh the datasheet so it displays the newly added record.

Add GoToNew Command in the Target Form's Open Event
Set the detail form to automatically navigate to a new blank record whenever it is opened.
Looking for a Lightweight Alternative for Your Office Needs?
While WPS Office does not feature a direct database alternative to Microsoft Access, it is an exceptionally robust, lightweight, and free alternative for Word, Excel, and PowerPoint. If you rely on spreadsheets for data management instead of complex relational databases, WPS Spreadsheet provides comprehensive data analysis and formatting tools with seamless Microsoft Office compatibility.
- 1. Download the Installer: Visit the official WPS Office website and download the free installation package.
- 2. Install WPS Office: Run the installer and follow the on-screen prompts to set up the software on your computer.
- 3. Manage Data in Spreadsheets: Open WPS Spreadsheet to import your tabular data, utilize advanced formulas, and export seamlessly to Excel formats.

Frequently Asked Questions
Why does my Access hyperlink open the first record instead of a new one?
By default, if an Access form is opened without specific filter criteria or a valid primary key ID to match, it defaults to displaying the first record available in its underlying record source.
What does the acFormAdd parameter do in Access VBA?
The acFormAdd constant is used with the DoCmd.OpenForm method to open a form specifically in Data Entry mode. This means the form will only display blank records for adding new data, hiding any previously existing records.
Can I open a new record in a form using Macros instead of VBA?
Yes. You can use the Access Macro Builder to assign an 'OpenForm' action to a button or hyperlink. In the macro settings, simply set the 'Data Mode' argument to 'Add' to achieve the same result without writing any VBA code.




