I want my users to be able to cycle through images by clicking navigation buttons (but not Navigation Buttons lol). I found some code on Stack Overflow that works like a charm. So in a sense, my problem is already solved. But I want to actually learn this stuff rather than just lifting code off the internet, so I was hoping someone might be able to explain it to me.
Here is the SO post: vba - Next Button that cycles back to first on Access Form - Stack Overflow
They provide this function to check whether a form is on the last record:
I just don't get why the .MoveFirst and .MoveLast are there. I understand that these moves are taking place in the Recordset clone, not the actual Recordset. Are these moves necessary to get an accurate RecordCount?
Here is the SO post: vba - Next Button that cycles back to first on Access Form - Stack Overflow
They provide this function to check whether a form is on the last record:
Code:
Private Function LastRecordP() As Boolean
With Me.RecordsetClone
If Not .EOF Then
.MoveLast
.MoveFirst
LastRecordP = Me.CurrentRecord = .RecordCount
End If
End With
End Function
I just don't get why the .MoveFirst and .MoveLast are there. I understand that these moves are taking place in the Recordset clone, not the actual Recordset. Are these moves necessary to get an accurate RecordCount?