Dear all,
How to make a notifications when going to the last record or back to the first record
Previous Button is ok
Code:
Private Sub gotoPrevious_Click()
On Error GoTo Err_gotoPrevious_Click
With Me.lstItems
.SetFocus
If .ListIndex < .ListCount Then
.ListIndex = .ListIndex - 1
MsgBox "First Contact", , "First Contact"
End If
End With
Exit_gotoPrevious_Click:
Exit Sub
Err_gotoPrevious_Click:
'MsgBox Err.Description
'MsgBox "End the Record"
Resume Exit_gotoPrevious_Click
End Sub
Next button not ok
Code:
Private Sub gotoNext_Click()
On Error GoTo Err_gotoNext_Click
With Me.lstItems
.SetFocus
If .ListIndex < .ListCount Then
.ListIndex = .ListIndex + 1
'MsgBox "End the Contact", , "End the Contact"
End If
End With Exit_gotoNext_Click:
Exit Sub Err_gotoNext_Click:
MsgBox Err.Description
Resume Exit_gotoNext_Click
End Sub