Jump to content
Sign in to follow this  
prichardson

Paging using a Loop to find the next and previous news

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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...