Simon said:
hi,
My problem is that, how can i know if the user moves the focus thorough a
form to the eof or the bof of the current file ?
I'm not sure I follow you. A form will not let you position its recordset
to the BOF or EOF position. You're either on the new record, in which case
the form's NewRecord property is True, or you're on an existing record, in
which case the NewRecord property is False. Aside from that, it's possible
to determine if you're on the form's first record (Me.CurrentRecord = 1)
and, with a bit more difficulty, whether you're on the last (but not new)
record:
Dim strWhichRec As String
If Me.NewRecord Then
strWhichRec = "new"
ElseIf Me.CurrentRecord = 1 Then
strWhichRec = "first"
Else
With Me.RecordsetClone
.MoveLast
If Me.CurrentRecord = .RecordCount Then
strWhichRec = "last"
Else
strWhichRec = "middle (" & Me.CurrentRecord & ")"
End If
End With
End If
MsgBox "We're on the " & strWhichRec & " record."