prichardson Posted May 15, 2008 Share Posted May 15, 2008 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 More sharing options...
justsomeguy Posted May 15, 2008 Share Posted May 15, 2008 The error that is gives is:do until rsNewsNav.Fields("NewsID") > strCurrentThat'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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.