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:
  1. Private Sub cmdNext_Click()
  2.    
  3.     Adodc1.Recordset.MoveNext
  4. If Adodc1.Recordset.EOF = True Then
  5.     cmdNext.enabled = false
  6. End If
  7. End Sub

I have also tried the following but it did not work:
VB Code:
  1. Private Sub cmdNext_Click()
  2.    
  3. If Adodc1.Recordset.EOF = True Then
  4.     cmdNext.enabled = false
  5. else
  6. Adodc1.Recordset.MoveNext
  7. End If
  8. End Sub