Jump to content

Paging using a Loop to find the next and previous news


prichardson

Recommended Posts

Is it possible to get this code to work. Trying to page. Here is a snippet of the code for the previous button.

' From the current record find the record with lower ID 'IF strFirst < strCurrent THEN				do until rsNewsNav.Fields("NewsID") > strCurrent								rsNewsNav.MovePrevious()				loop				strPrevious = rsNewsNav.Fields("NewsID")ELSE				strPrevious = strFirstEND IF

So when you click on the button it gets the next one by doing a loop.The error that is gives is:do until rsNewsNav.Fields("NewsID") > strCurrentI am not sure if we are able to use this " rsNewsNav.Fields("NewsID") " in the loop ?Any suggestions would be great.

Link to comment
Share on other sites

The error that is gives is:do until rsNewsNav.Fields("NewsID") > strCurrent
That's not an error, that's a line of code. You're referencing a field object though, not a value. If you want to reference the value of a field in the recordset you do it like this:rsNewsNav.Fields.Item("NewsID").Value
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...