Others

Open a Selected Access Subform Record in an Editable Pop-Up Form

Adam DavisAdam Davis Nov 27, 2026 869 views

Question details

Open a selected datasheet subform record in a separate form where its fields can be viewed and edited more easily.

Open a Selected Access Subform Record in an Editable Pop-Up Form
Product
Microsoft Access
Device & OS
not provided
Scenario
A datasheet subform contains related records with too many fields to view comfortably in a single row.
Observed behavior
Double-clicking a record should open an editable pop-up form filtered to that record.
Before you start

Identify the subform's primary-key field and the control that displays it. Confirm that the detail form uses an updatable record source containing that key and that its Allow Edits property is set to Yes.

Solution 1Recommended

Open a Filtered Detail Form from the Subform

Use a double-click event on the subform's key control to open the selected record in an editable pop-up form.

The example uses a numeric primary key named ID and a detail form named frmRecordDetail. Replace these names with the field, control, and form names used in your database.

1
Set up the detail form

Open frmRecordDetail in Design View. In the Property Sheet, set Default View to Single Form, Pop Up to Yes, and Allow Edits to Yes. Add the fields you want to view and edit, then save the form.

2
Create the double-click event

Open the datasheet subform in Design View and select its ID control. In Property Sheet > Event, set On Dbl Click to [Event Procedure], then click the builder button to open the VBA editor.

3
Add the OpenForm command

Inside the generated ID_DblClick event procedure, enter: DoCmd.OpenForm "frmRecordDetail", acNormal, , "[ID]=" & Me![ID], acFormEdit. The filter passes the current subform record's numeric ID to the detail form.

4
Test the pop-up

Save the subform, open the main form, and double-click the ID cell of a saved subform record. Confirm that the pop-up shows that record and allows you to edit its fields.

Open a Filtered Detail Form from the Subform
Text primary keys: For a text key, enclose the value in single quotes and escape embedded apostrophes. For example, use "[ID]='" & Replace(Me![ID], "'", "''") & "'" as the WhereCondition argument.
Free Microsoft Office alternative

Work with Office Files in WPS Office

WPS Office is a free, lightweight alternative for working with documents and spreadsheets in a familiar interface, making it easy to move everyday Office files between applications. It does not replace Microsoft Access forms or fix Access-specific VBA issues.

Use a familiar interface for everyday Office tasksOpen and edit compatible Microsoft Word and Excel formats, including DOCX and XLSXView and organize tabular data in WPS SpreadsheetsMove common Office files to a lightweight, free office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the pop-up show more than one record?

Check the WhereCondition in the DoCmd.OpenForm command. It must compare the detail form's primary-key field with the current subform record's key value, such as "[ID]=" & Me![ID] for a numeric key.

Why can't I edit the record in the detail form?

Open the detail form in Design View and check Property Sheet > Data > Allow Edits. Also verify that its record source is updatable and that you have permission to edit the underlying data.

Can I open the form by double-clicking a different cell?

Yes. In the subform's Design View, select that control and create its On Dbl Click event procedure. The code can still reference Me![ID] to filter the detail form by the current record's key.

What can I use instead of a separate pop-up?

You can use a continuous form with a redesigned layout. Open the subform in Design View, set Default View to Continuous Forms, and arrange the fields across a larger detail section.