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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

returning to a record on a subform

Status
Not open for further replies.

jpwcyc

Programmer
Jan 3, 2000
2
US
I have a form that has a tab control and on the second tab page is a subform in datasheet view. I click on one of the records to open a seperate form for editing. I have a close button on that form that forces a requery on the first form and then sets focus back to the first form. The problem is that I want to set the focus back to the record in the subform that I clicked on.
 
How are ya jpwcyc . . .

Here's the Idea:
Code:
[blue]   Dim frm As Control, HldID As Long
   
   Set frm = Forms![purple][b]CallingFormName[/b][/purple]
   HldID = frm![purple][b]ControlName[/b][/purple]
   frm.Requery
   frm.Recordset.FindFirst "[[purple][b]ControlName[/b][/purple]] = " & HldID[/blue]

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top