Selecting a record from a subform

  • Thread starter Thread starter SheldonMopes
  • Start date Start date
S

SheldonMopes

I have a subform which is based on a query. I would like to be able to
double-click on the record in the sub-form and have another form open
which will display the record matching the record in the subform.
(Same table, based on primary key). Any ideas ? I am now using a bound
control on the main form, linked to the record ID in the subform, but
it doesn't always work, and I don't know why.
 
1.Open your Subform in design view
2.Bring up its Property sheet
3.In its "On Double Click" procedure:
-----------------------------------------------
Private Sub Form_DblClick(Cancel As Integer)

If Not Me.NewRecord Then
DoCmd.OpenForm "YourForm", , , "[YourID]=" & Me.YourID
End If

End Sub
-----------------------------------------------

of course, change the names in the example to fit your specific needs

HTH,
Brian
 
Back
Top