Record Navigation Buttons

RexesOperator

Registered User.
Local time
Today, 11:09
Joined
Jul 15, 2006
Messages
604
I seem to recall code that allows Next and Previous buttons to wrap around the "top" and "bottom" of a record set. So that if you are at the first record, Previous will wrap to the last record and if you are at the last record Next will wrap to the first one.

I have tried the usual suspects - including Allen Browne, Steven Lebans and Martin Greene as well as this site and a few others. I just can't seem to locate it.

Does anyone remember where it is? Thanks.
 
I know that Steven Lebans has a sample for custom navigation bar, and you could just alter the code so if it's at last record to move to the first record and vice versa. I do not think I've ever seen this as a sample, though.
 
I looked at that one - it doesn't have the wrapping effect. Mainly I want to avoid the "You cant go to the specified record" message.
 
Yes, but as I said, you can alter the code.
 
Sorry to be so long getting back to you on this - the problem is I wouldn't know how to alter the code. Actually I think I may have this in one of the books I've got. If I find it I will post it.
 
I use a simple macro. Here it is converted to code. There are no messages appear, it just goes to the first record when Clicked at the last record.

DoCmd.GoToRecord , "", acNext
If (Eval("[CLSurname] Is Null")) Then
DoCmd.GoToRecord , "", acFirst
End If

The macro action is GoToRecord and one for Next and the next line GoToRecord and First and on the Condition line is [CLSurname] Is Null
 
Adam

Only problem is the reverse does not work ie. Previous, when at the first record.....brings up the Can't go to Specified Record msg. I just tried that out of curiousity as I only worry about "last record" and then doing the loop around back to first.
 

Users who are viewing this thread

Back
Top Bottom