468,103 Members | 1,307 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,103 developers. It's quick & easy.

Using subform to go to record in subform

I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the record.
There is a button (transparent) over the record on subform1 that when
clicked should force the second subform to goto that record. Any thoughts on
how to go about this?

Thanks Robert
Oct 7 '06 #1
3 4581
Robert wrote:
I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the record.
There is a button (transparent) over the record on subform1 that when
clicked should force the second subform to goto that record. Any thoughts on
how to go about this?

Thanks Robert

Why a button? Why not in a dbl-click event? In form1, the click event
code could resemble
Dim rst As Recordset
set rst = Forms!Form2.Form.Recordsetclone

'change here to reflect your key
rst.FindFirst "ID = " & Me.ID

Forms!Form2.Form.BookMark = rst.BookMark
rst.close
set rst = Nothing
Oct 8 '06 #2
Not having much luck with below. I'm assuming that Forms!Form2... is
refering to Subform2? Even so, it isn't working. The button is on Subform1
(the index) and I am trying to change to record in Subform2 (the single
form).

So it should read Forms!Subform2.Form.Recordsetclone?

When I do this access return error 2450, it can't find the form frmSubform2

"salad" <oi*@vinegar.comwrote in message
news:12*****************@newsread3.news.pas.earthl ink.net...
Robert wrote:
>I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the
record. There is a button (transparent) over the record on subform1 that
when clicked should force the second subform to goto that record. Any
thoughts on how to go about this?

Thanks Robert
Why a button? Why not in a dbl-click event? In form1, the click event
code could resemble
Dim rst As Recordset
set rst = Forms!Form2.Form.Recordsetclone

'change here to reflect your key
rst.FindFirst "ID = " & Me.ID

Forms!Form2.Form.BookMark = rst.BookMark
rst.close
set rst = Nothing

Oct 8 '06 #3
Robert wrote:
Not having much luck with below. I'm assuming that Forms!Form2... is
refering to Subform2? Even so, it isn't working. The button is on Subform1
(the index) and I am trying to change to record in Subform2 (the single
form).

So it should read Forms!Subform2.Form.Recordsetclone?

When I do this access return error 2450, it can't find the form frmSubform2
Sorry. When referring to a subform, you must make a reference to the
parent form. Ex:
Forms!MainForm!SubForm.Form...
>
"salad" <oi*@vinegar.comwrote in message
news:12*****************@newsread3.news.pas.earthl ink.net...
>>Robert wrote:

>>>I have a form with two subforms on it. both subs have the same
controlsource. Subform1 is a continuous form that acts as an index. The
second subform is a single record that the user will use to edit the
record. There is a button (transparent) over the record on subform1 that
when clicked should force the second subform to goto that record. Any
thoughts on how to go about this?

Thanks Robert

Why a button? Why not in a dbl-click event? In form1, the click event
code could resemble
Dim rst As Recordset
set rst = Forms!Form2.Form.Recordsetclone

'change here to reflect your key
rst.FindFirst "ID = " & Me.ID

Forms!Form2.Form.BookMark = rst.BookMark
rst.close
set rst = Nothing


Oct 8 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by sixsoccer | last post: by
18 posts views Thread by Darryl Kerkeslager | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.