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!

Access 2000 Datasheet Scrollbar position 1

Status
Not open for further replies.

TheDude53

Programmer
May 27, 2005
8
GB
Hi everyone,

Was wondering if anyone can help me?

I have a subform (datasheet) which is completely dynamic with a vertical scroll bar. Certain functions called on the parent form force the child subform to be rebuilt. When this occurs I need to locate the previous record displayed on the datasheet. Finding the previous record is easy enough however I have been unable to find out how to reposition the child form so the record in question is displayed. At the moment when the form is rebuilt it returns to the top.

If anyone can help me out on this one it would be very handy.

Cheers,
Rob
 
Try Linking the form to the master with an invisible text box. Before updating the child (i.e. when you know what record you're on, stick a value of a unique field in that record into an invisible text box on both the child and master. When the form is rebuilt, it should jump to that record. If you don't have unique record identifiers in your child table or query, you might want to add one (it doesn't have to be visible to the user, remember ?) Hope this helps ... it's a tricky one. I hate SubForms ! ;-)

Alan J. Volkert
Fleet Services
GE Commercial Finance Capital Solutions
(World's longest company title)
Eden Prairie, MN
 
How are ya TheDude53 . . .

Something like:
Code:
[blue]   [green]'Considers code running from parent form[/green]
   Dim sfrm As Form, hldID
   
   Set sfrm = [subFormName].Form
   
   hldID = sfrm!idFieldName
   [green]'Function calls to rebuild here[/green]
   sfrm.Recordset.FindFirst "[IDFieldName] = " & hldID[/blue]

Calvin.gif
See Ya! . . . . . .
 
cheers for the two approaches - and thanks TheAceMan1 - i had forgotten i could do a recordset findfirst on a subform (plonker i know!) :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top