Others

How to Open a Blank Access Form from a New Datasheet Row

Ayan MasoodAyan Masood Nov 3, 2026 869 views

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.

How to Open a Blank Access Form from a New Datasheet Row
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.
Before you start

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.

Solution 1Recommended

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.

1
Open Subform in Design View

Right-click your subform in the navigation pane and select 'Design View'.

2
Access the Hyperlink Event

Select the hyperlink control in the datasheet, open the Property Sheet (F4), and navigate to the 'Event' tab.

3
Open the VBA Editor

Locate the 'On Click' event, select [Event Procedure] from the dropdown, and click the ellipsis (...) button to open the VBA Editor.

4
Insert the Null Check Condition

Enter the condition 'If IsNull(Me.YourIDControlName) Then' to check if the current row is a new, unsaved record.

5
Add the OpenForm Command

Inside the If block, type 'DoCmd.OpenForm "YourDetailFormName", , , , acFormAdd, acDialog' to open the detail form in Add mode.

6
Handle Existing Records and Requery

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.

Use an If IsNull Condition with acFormAdd
Replace Placeholder Names: Make sure to replace 'YourIDControlName' and 'YourDetailFormName' with the actual names of the ID control and the detail form in your specific Access database.
Free Microsoft Office alternative

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. 1. Download the Installer: Visit the official WPS Office website and download the free installation package.
  2. 2. Install WPS Office: Run the installer and follow the on-screen prompts to set up the software on your computer.
  3. 3. Manage Data in Spreadsheets: Open WPS Spreadsheet to import your tabular data, utilize advanced formulas, and export seamlessly to Excel formats.
Free, all-in-one suite for word processing, spreadsheets, and presentations.Highly compatible with Microsoft Office file formats (.docx, .xlsx, .pptx).Familiar, tabbed user interface for easy navigation and smooth migration.Lightweight installation that doesn't consume excessive system resources.
microsoft office alternative - wps office

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.