First and Last record check?

T

Tony

How can I write a code to check if the current record is
first or last record.

Thank you in advance,
Tony
 
M

Marshall Barton

Tony said:
How can I write a code to check if the current record is
first or last record.


If Me.CurrentRecord = 1 Then
'First record
ElseIf Me.CurrentRecord = Me.recordsetClone.RecordCount Then
'Last record
Else
'not first or last
End

If you do not get the right number for RecordCount, then add
a Me.RecordsetClone.MoveLast to the form's Load event.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top