Open an Access Form Record from a Query Result
Question details
Open a specific Membership form record from a selected query result in an Access split form.

- 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.
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.
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.
In the Access Navigation Pane, right-click the split search form and select Design View.
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.
In the control's Click procedure, enter: If IsNull(Me!MemberID) Then Exit Sub DoCmd.OpenForm "Membership", WhereCondition:="[MemberID]=" & Me!MemberID
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.
Save the form, open it in Form View, run the search, and click an ID. Confirm that Membership opens to the matching record.

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.

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.




