I am using the following code to Disable the custom First, Last and New Record buttons but receive an error message when I press one of those buttons and being relatively new, do not understand why. Could someone explain please?
The code is
Private Sub Form_Current()
On Error Resume Next
If Me.CurrentRecord = 1 Then
Me.cmdPrevious[highlight #729FCF].Enabled =[/highlight] False
Else
Me.cmdPrevious.Enabled = True
End If
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
Me.cmdNext.Enabled = False
Else
Me.cmdNext.Enabled = True
End If
If Me.NewRecord Then
Me.cmdNewRecord.Enabled = False
Else
Me.cmdNewRecord.Enabled = True
End If
End Sub[highlight #729FCF][/highlight]
The error is 'Compile Error - Method or Data Member not found' with the first '.Enabled' highlighted
Regards
Smalty
The code is
Private Sub Form_Current()
On Error Resume Next
If Me.CurrentRecord = 1 Then
Me.cmdPrevious[highlight #729FCF].Enabled =[/highlight] False
Else
Me.cmdPrevious.Enabled = True
End If
If Me.CurrentRecord >= Me.Recordset.RecordCount Then
Me.cmdNext.Enabled = False
Else
Me.cmdNext.Enabled = True
End If
If Me.NewRecord Then
Me.cmdNewRecord.Enabled = False
Else
Me.cmdNewRecord.Enabled = True
End If
End Sub[highlight #729FCF][/highlight]
The error is 'Compile Error - Method or Data Member not found' with the first '.Enabled' highlighted
Regards
Smalty