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!

How do I pull info from the next record?

Status
Not open for further replies.

tvsmvp

Technical User
Aug 17, 2006
59
US
How would I pull information (into my form) from the next or previous record? I've tried this: Me!NextPartTitle.Value = DLookup("[PageTitle]", "Articles", "[ID] = " & [ID] + 1)

which gets me into trouble when the id doesn't exist. Do I have to loop till it finds a higher-numbered ID? Or will something akin to "Next Record" work? The documentation on Next Record says it'll move me to the next record - which isn't what I want - but I figured something's gotta be out there, some function or other, that handles this sorta thing. Any suggestions?
 
You can use the recordset clone to get the next record. For example:
Code:
Set rs = Me.RecordsetClone
rs.Bookmark = Me.Bookmark
rs.MoveNext
lngID=rs!ID

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top