Open a Selected Access Subform Record in an Editable Pop-Up Form
Question details
Open a selected datasheet subform record in a separate form where its fields can be viewed and edited more easily.

- 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.
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.
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.
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.
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.
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.
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.

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.

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.




