Still stuck

G

Guest

When one record is selected in a subform, I would like the same record
displayed on another subform. Would I use the On Click event to do this and
what code would I use? Sorry this may be basic, but Im still learning.
Thanks Tim
 
K

Ken Snell [MVP]

No, use the Current event of the first subform to run code that "moves" the
other subform to the desired record.
 
G

Guest

Ken thank you, that makes sense, any idea on the code I need to move the
focused/current record in form2 to the same record displayed in form1
 
K

Ken Snell [MVP]

Use the primary key's value to do this:

Private Form_Current()
With Me.Parent.Subform2.Form.RecordsetClone
.MoveFirst
.FindFirst "[NameOfPrimaryKey] = " & Me.NameOfPrimaryKey.Value
Me.Parent.Subform2.Form.Bookmark = .Bookmark
End With
End Sub

Subform2 is the name of the control that holds the second subform.
--

Ken Snell
<MS ACCESS MVP>
 
G

Guest

Thank you Ken, I will try this today. By the way, if I click on the yes
answer to "was this reply useful" within this forum, is that the same as
saying thank you, or is it polite to write a reply?

Ken Snell said:
Use the primary key's value to do this:

Private Form_Current()
With Me.Parent.Subform2.Form.RecordsetClone
.MoveFirst
.FindFirst "[NameOfPrimaryKey] = " & Me.NameOfPrimaryKey.Value
Me.Parent.Subform2.Form.Bookmark = .Bookmark
End With
End Sub

Subform2 is the name of the control that holds the second subform.
--

Ken Snell
<MS ACCESS MVP>


Timboo said:
Ken thank you, that makes sense, any idea on the code I need to move the
focused/current record in form2 to the same record displayed in form1
 
K

Ken Snell [MVP]

The "Was this reply useful" in the forum is to help other readers who may be
searching the forum for information. I don't get any type of reply from that
action, and because I don't use the MS browser link for this newsgroup I
don't even see that rating.

Some posters say thanks, and some don't. While not required or expected by
us answerers, we do enjoy reading such responses and it does help us know if
the info we provide is useful or not.

Good luck.
--

Ken Snell
<MS ACCESS MVP>



Timboo said:
Thank you Ken, I will try this today. By the way, if I click on the yes
answer to "was this reply useful" within this forum, is that the same as
saying thank you, or is it polite to write a reply?

Ken Snell said:
Use the primary key's value to do this:

Private Form_Current()
With Me.Parent.Subform2.Form.RecordsetClone
.MoveFirst
.FindFirst "[NameOfPrimaryKey] = " & Me.NameOfPrimaryKey.Value
Me.Parent.Subform2.Form.Bookmark = .Bookmark
End With
End Sub

Subform2 is the name of the control that holds the second subform.
--

Ken Snell
<MS ACCESS MVP>


Timboo said:
Ken thank you, that makes sense, any idea on the code I need to move the
focused/current record in form2 to the same record displayed in form1

:

No, use the Current event of the first subform to run code that
"moves"
the
other subform to the desired record.

--

Ken Snell
<MS ACCESS MVP>

When one record is selected in a subform, I would like the same record
displayed on another subform. Would I use the On Click event to do this
and
what code would I use? Sorry this may be basic, but Im still learning.
Thanks Tim
 

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