Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if click on the record in the subform-->this record must be open in a

Status
Not open for further replies.

iomega

Technical User
Mar 19, 2002
12
0
0
BE
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 .

Thanks in advance for your feedback.

Iomega
 
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..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top