I have a subform with record's.
The goal is :
If the user double click on a record's , this record opens with a new form and the user modify and save the record .
In the subform's "on dbl click" event just reference the opening of the editing form...e.g.,
'filter search criteria according to user selection in 'subform...this routine uses the RecordsetClone property
'of the form to take advantage of the FindFirst method
Dim MySet As Recordset
Dim StrCriteria As String
StrCriteria = "[My_ID] Like'*" &_ Forms![MyMainForm].Form![MySubForm]![My_ID] & "*'"
'note the Like statment allows partial string searching..
'not necessary to use this if an exact match is expected...
Set MySet = Forms![MyEditForm].RecordsetClone
MySet.FindFirst StrCriteria
Forms![MyEditForm].Bookmark = MySet.Bookmark
Forms![MyEditForm].Visible = True
DoCmd.Close acForm, "MyMainForm"
Exit Sub
'if the ID field is in the subform this code assumes it's in the Edit form as well..
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.