Open form for record selected in subform

R

rocketD

Hello,

I have 3 forms. The starting form (#1) has an unbound combobox from
which users can select a clinic, and a subform (#2) in datasheet
format. The subform runs off a query that is tied to the clinic that
the user selects on the parent form. Because the subform is based on
a query that ties several normalized tables together, I cannot edit
the fields in that subform. Therefore, when the data display, I want
to be able to click on the ID field of any record and have another
form (#3) popup to show detailed, editable information for that
specific record. I have tried setting the Double Click event of the
ID field of the subform to open the third form, but it doesn't work;
it gives me the window asking me to specify the ID criteria being
pulled from the subform. Here is my code:

Private Sub PEARID_DblClick(Cancel As Integer)
DoCmd.OpenForm "fmParticipantRecords", acNormal, ,
"forms.fmParticipantRecords.PEARID Like
forms.subfmQryByCriteria.PEARID"
End Sub

Can anyone tell me what I must do to select the ID displayed in the
record on which I double-click?

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top