EOF not working right for me
Hello, in my program I have a Next and Previous button. If for example I have 14 records in my access database, I want the next button to disable itself on the 14th record (or last one). I tried the following code but it does not disable itself until one after the last entry.
VB Code:
Private Sub cmdNext_Click()
Adodc1.Recordset.MoveNext
If Adodc1.Recordset.EOF = True Then
cmdNext.enabled = false
End If
End Sub
I have also tried the following but it did not work:
VB Code:
Private Sub cmdNext_Click()
If Adodc1.Recordset.EOF = True Then
cmdNext.enabled = false
else
Adodc1.Recordset.MoveNext
End If
End Sub
Re: EOF not working right for me
If you don't include the "if" part, does it eventually give you an error? In other words, does it ever reach the EOF?