Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to keep the subform not to go back to the first record? 2

Status
Not open for further replies.

LittleNick

Technical User
Jun 26, 2009
55
US
Hi,
I have a MainForm which has 2 subforms in it. namely subForm1 and subForm2. In subForm1 I have several hundred of records and when I double click on one of the record, it then highlight that record selected and display the detail of that record in SubForm2. My problem is when I scroll down to find the desired record in Subform1 I double click it, the Subform2 displays the correct info but the SubForm1 automatically go back to the first record, so I have to scroll down again to find the record selected (highlighted). Is there a way to make the Subform1 to stay so that the selected record shows on the Subform1?

Thanks for Helps.
 
Not sure because you provided no code.
I would just remove the whole double click, and synchronize my main form to subform1 and synch subform 2 to subform 1.
That way whatever record I scroll in subform 1 I show the details in subform 2.

1) Link Main form to subform1
2) on the main form put a text box and make it hidden. "txtBxLink"
3) In the on current event of subform1
me.parent.txtBxLink = me.thefieldThatLinks
4)Link subform 2 as follows
linkMasterField: [txtBxLink]
linkChildField: [thefieldthatlinks]

Get rid of you other code, because there is an unneeded requery that causes it to go to the top.
 
How are ya LittleNick . . .

Agree with [blue]MajP[/blue] ... however you can't just scroll, you still have to select a record in sfrm1. Once your linked as suggested you simply [blue]click the record selector[/blue] in sfrm1.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Thanks Majp and TheAceMan1 for your replies.
I finally got a chance to try Majp's suggestion and it works great. Like TheAceMan1 mentioned, I did have to select the record on subform1. I really appreciate your helps.
THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top