Others

Open an Access Form Record from a Query Result

Chanuka GeekiyanageChanuka Geekiyanage Nov 20, 2026 869 views

Question details

Open a specific Membership form record from a selected query result in an Access split form.

Open an Access Form Record from a Query Result
Product
Microsoft Access
Device & OS
not provided
Scenario
A user searches a split form and clicks an ID control to open the corresponding membership record.
Observed behavior
The Membership form should open filtered to the record whose ID matches the selected result.
Before you start

Check the name and data type of the ID field in the Membership form's record source, and confirm that the search form has a control bound to the matching ID. The example below assumes MemberID is numeric.

Solution 1Recommended

Open the Membership form with a filtered Click event

Use the ID control's Click event to pass the current record's numeric MemberID to the Membership form.

1
Open the search form in Design View

In the Access Navigation Pane, right-click the split search form and select Design View.

2
Create the Click event

Select the control bound to MemberID, open its Property Sheet, and on the Event tab set On Click to [Event Procedure]. Click the ellipsis button to open the VBA editor.

3
Add the OpenForm code

In the control's Click procedure, enter: If IsNull(Me!MemberID) Then Exit Sub DoCmd.OpenForm "Membership", WhereCondition:="[MemberID]=" & Me!MemberID

4
Match your field names

Replace Membership with the target form name, [MemberID] with the numeric ID field in that form's record source, and Me!MemberID with the search form's bound ID control. For a field named Database ID #, use "[Database ID #]=" & Me.[Database ID #] when both names match.

5
Test a result

Save the form, open it in Form View, run the search, and click an ID. Confirm that Membership opens to the matching record.

Open the Membership form with a filtered Click event
Check the ID type: The example is for numeric IDs. Text IDs require quotation marks around the value and escaping any embedded quotation marks.
Free Microsoft Office alternative

Work with Office documents alongside your Access database

WPS Office is a free, lightweight alternative for everyday documents, spreadsheets, and presentations. Its familiar interface and Office format compatibility make it easy to move existing files. Keep Microsoft Access for Access forms and VBA, which WPS Office does not run.

Review membership lists and search results in spreadsheets.Open and edit Microsoft Office formats, including DOCX, XLSX, and PPTX.Use a familiar interface for an easier transition from Microsoft Office.Work with a free, lightweight office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Membership form open to no records?

Check that the ID value exists in the Membership form's record source and that the field named in WhereCondition matches that source. Also confirm the search control is bound to the correct ID.

Can I use Database ID # instead of MemberID?

Yes. If Database ID # is the numeric field in the target form's record source and the search control has the same name, use "[Database ID #]=" & Me.[Database ID #] as the WhereCondition.

Where do I enter the VBA code?

Open the search form in Design View, select the ID control, and use Property Sheet > Event > On Click. Choose [Event Procedure] and click the ellipsis button to open the VBA editor.

Does the same filter work for a text ID?

Not as written. A text ID must be enclosed in quotation marks in the WhereCondition, and embedded quotation marks in its value must be escaped.