you can test
Private Sub NextRecord_Click()
'Proceed to next record
RowNum = RowNum + 1
Do Until Cells(RowNum, 1).Height > 0 Or IsEmpty(Cells(RowNum, 1))
RowNum = RowNum + 1
Loop
If Cells(RowNum, 1).Value <> vbNullString Then
GetData Cells(RowNum, 1)
Me.Caption = "Rijnummer: " & RowNum
Else
'It's not allowed to skip last record
Beep
RowNum = RowNum
Me.Caption = "Laatste rij met gegevens in deze lijst !!!"
End If
End Sub
Private Sub PreviousRecord_Click()
'Go back one record
RowNum = RowNum - 1
Do Until RowNum = 2 Or Cells(RowNum, 1).Height > 0
RowNum = RowNum - 1
Loop
If RowNum = 1 Then
RowNum = 2
Beep
Me.Caption = "Eerste rij met gegevens in deze lijst !!!"
Else
Me.Caption = "Rijnummer: " & RowNum
GetData Cells(RowNum, 1)
End If
End Sub