Button1=previous record. Push Button on record zero=CRASH

J

Jeanette Cunningham

Faz,
if using a bound form, you can find out if there are any records by counting
the records using the recordsetclone.

The following has not been tested for your exact situation

If Len(Me.RecordSource) >0 Then
If Me.RecordsetClone.RecordCount > 0 Then
Me.Button1.Enabled = True
Else
Me.Button1.Enabled = False
End If
End If

Another possibility applies if your form allows new records.
You can test the New Record property. If the form is at a new record, then
disable the button.

If Me.NewRecord = True Then
Me.Button.Enabled = False
Else
Me.Button.Enabled = True
End If

You would need the code on the On Current event of the form
and on any other event that could change the record source of the form.


Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top