Scenario (Applies to Access 2003, 2007 and 2010)
There are two open forms, frmEmployees and frmTransactions. frmEmployees and frmTransactions are bound to tblEmployees and tblTransactions. They have a common field which is EmployeeID.
Task
Filter a record from frmEmployee where EmployeeID correspond on the selected row in frmTransactions.
Approach
On the Click Event of TransactionDetail field in frmTransactions, put this code:
Private Sub TransactionDetail_Click()
’ Find the record that matches the control.
Dim rs As Object
Set rs = Forms!frmEmployees.Recordset.Clone
rs.FindFirst “[ID] = ” & Nz(Me.EmployeeID, 0)
If Not rs.EOF Then Forms!frmEmployees.Bookmark = rs.Bookmark
End Sub