Click to See Complete Forum and Search --> : Deleting First Record in Recordset causes error


chem1
October 17th, 1999, 11:07 PM
Whenever I delete the first record in my database VB generates an error. One way of avoising this is to disable the Delete menu at the first record.But is there a better ,logical way to avoid this?
Thankx in advance

October 18th, 1999, 05:27 AM
Hi,

Before trying to Delete the first record in the database, are you actually positioning the record pointer (cursor) to the begining of the recordset?

If you aren't, then try it, because it may get rid of your problem.

chem1
October 18th, 1999, 11:42 PM
And how do I actually point the cursor at the first record?Does it not actually come at the first record when I delete the second last record?

Harry Gilbert
October 19th, 1999, 10:02 AM
Use the MoveFirst method of the Recordset object. Check for BOF (Beginning of File) to see if you're already there. If both BOF and EOF are true, file is empty.