xtraterrestrial
To do this, you have to manually run to things...
First upon a load and apply filter events, you need to run a count of the number records for the record set. This will be your Y number. There are numerous variations...
I am going to assume you have two text fields on the form
Me.intYCount
Me.intXPosition
Dim intYCount As Integer, strSQL As String
'Need to determine you where clause for this example
'For the entire record set, use something that will retrieve all records
strSQL = "xxxVariable > 0"
strSQL = "xxxVariable not null"
strSQL = "xxxVariable = " & YourFilter
Me.RecordsetClone.FindFirst strSQL
If Not Me.RecordsetClone.NoMatch Then
Me.RecordsetClone.MoveLast
intYCount = Me.RecordsetClone.RecordCount
Me.RecordsetClone.MoveFirst
Me.intYCount = intYCount
Me.intXPosition = 1
End If
Second, you need to track the ralative position. Perhaps a simple way would be to use an unbound text field. Set it to 0 (at the same time you run your count - on the load and after applying a filter).
With the forward button
Me.intXPosition = Me.intXPosition + 1
For the back button
Me.intXPosition = Me.intXPosition -1
So not to look funny, you will probably need some logic...
If Me.intXPosition < 1 then Me.intXPosition = 1
and
If Me.intXPosition > Me.intYCount then Me.intXPosition = Me.intYCount
I have not used this code so you may have to tweak it to get it work.
Richard