Others

Open the Selected Subform Record in a Microsoft Access Popup Form

Adam DavisAdam Davis Nov 20, 2026 869 views

Question details

Open a popup form to the record selected in a subform.

Open the Selected Subform Record in a Microsoft Access Popup Form
Product
Microsoft Access
Device & OS
not provided
Scenario
A button on a form opens a popup note form for the currently selected subform record.
Observed behavior
The popup may open a new record instead of the matching selected record.
Before you start

Identify the main form name, the subform control name, and the control that holds CommunicationID. Confirm that the popup form's record source includes the matching CommunicationID field.

Solution 1Recommended

Pass the Selected CommunicationID to the Popup Form

Use a fully qualified subform reference and filter the popup to the selected numeric ID.

1
Check the subform control name

Open the main form in Design View, select the subform container, and check its Name on the Property Sheet. This control name may differ from the name of the form displayed inside it.

2
Open the button event procedure

Select the button that opens the popup. On the Property Sheet's Event tab, set On Click to [Event Procedure] and click the build button to open the VBA editor.

3
Read the selected ID and open the popup

In the button's Click procedure, use the following example, replacing MainFormName, SubformControlName, and CommunicationID with your actual names: Dim selectedID As Variant selectedID = Forms!MainFormName!SubformControlName.Form!CommunicationID If IsNull(selectedID) Then MsgBox "Select a record with a CommunicationID first." Exit Sub End If DoCmd.OpenForm "PopupComNoteF", WhereCondition:="[CommunicationID]=" & selectedID

4
Check the popup settings and test

Open PopupComNoteF in Design View and set Data Entry to No on its Property Sheet. Save the forms, select an existing subform record, and click the button to verify that the popup shows the matching note.

Pass the Selected CommunicationID to the Popup Form
Match the field type: The example assumes CommunicationID is numeric. If it is a text field, enclose the value in single quotes in the WhereCondition and escape any embedded single quotes.
Free Microsoft Office alternative

Use WPS Office for Everyday Documents and Spreadsheets

WPS Office is a free, lightweight alternative for common Office work, with a familiar interface and support for Microsoft Office file formats. It can help you move document and spreadsheet work across, but it does not run or repair Microsoft Access forms or VBA database applications.

Create and edit documents and spreadsheets in a familiar interfaceOpen and work with Microsoft Office formats including DOCX, XLSX, and PPTXKeep database form development in Microsoft Access while using WPS for related reportsUse a free, lightweight suite for everyday office tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does the subform reference include .Form?

The subform control is a container on the main form. Its Form property gives you access to the controls on the form displayed inside it, as in Forms!MainFormName!SubformControlName.Form!CommunicationID.

How do I find the subform control name?

Open the main form in Design View, select the subform container, and check Name on the Property Sheet. Use that name in the reference, even if the form inside has a different name.

Why does the popup still open to a new record?

In the popup form's Property Sheet, check that Data Entry is set to No. Also confirm that its record source includes CommunicationID and that the selected ID matches an existing record.

Can WPS Office run this Access popup form?

No. This solution requires Microsoft Access because it uses Access forms, the Forms collection, and Access VBA. WPS Office can be used separately for compatible documents and spreadsheets.