chem1
Oct 26th, 1999, 12:21 AM
How do I prevent my Program from crashing when I delete the only record in the recordset.
Thankx in advance....
JHausmann
Oct 26th, 1999, 03:27 AM
There are a number of ways.
1) don't delete the last record. I have an application that tells the user they cannot delete the last record (it checks to see how many records are stored in the DB prior to deleting. If record count = 1, msgbox user)
2) you could use the command:
On Error resume next
This could, however lead to spurious errors occurring until you get a record in your database.
3) don't use bound controls. Jet and ODBC don't care if your tables are populated. You'll still need to deal with coding for empty tables, though.
4) a modification of # 1 above, if it's the last record, delete the record you want after adding a new one.