Hi, I think this may be what you are looking for:
In the datasheet form put this code in the Declarations section:
Option Compare Database
Option Explicit
Private WithEvents m_form As Form
In the datasheet form put this code in the close button On_Click Event It supposes that the datasheet form has a subform in a control called SubSummary and the primary key is called PkId. It also assumes the main form is called frmMainForm:
Private Sub cmdExit_Click()
On Error Resume Next
Dim lngId As Long
lngId = Me!SubSummary.Form!PkId
If IsLoaded("frmMainForm"

Then
m_form.Filter = "[PkIdID] = " & lngId
m_form.FilterOn = True
Forms!frmMainForm.Visible = True
End If
DoCmd.Close acForm, "frmOrdersSummary"
End Sub
This goes in the datasheet Open Event:
Private Sub Form_Open(Cancel As Integer)
On Error Resume Next
'Set m_form to the main form object
Set m_form = Forms!frmMainForm
End Sub
A bit of explanation. Declaring m_form as a Private object WithEvents and defining it on the Open event of the datasheet makes the main form (provided it is loaded but invisible) synchronise and be controlled by the current form. You have access to all its events and can cause them to fire from within the code on the controlling form.
Selecting any record on your datasheet should immediately filter the underlying main form to the record selected when you close the datasheet.
Hope this helps.
Saltecho