From: rocketD on
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!
From: Maarkr on
maybe
DoCmd.OpenForm "fmParticipantRecords", acNormal, ,"PEARID=" & Me.PEARID

"rocketD" wrote:

> 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!
> .
>
From: rocketD on
On May 13, 10:48 am, Maarkr <Maa...(a)discussions.microsoft.com> wrote:
> maybe
>  DoCmd.OpenForm "fmParticipantRecords", acNormal, ,"PEARID=" & Me.PEARID
>
>
>
> "rocketD" wrote:
> > 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!
> > .

Totally worked! You rock, thanks!
 | 
Pages: 1
Prev: HOME!!!!!
Next: Access and Sharepoint