Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deleting records in a DB

Status
Not open for further replies.

allis

Technical User
Oct 16, 2002
11
0
0
US
On my delete button, I have a message box come up asking if they are sure they want to delete, yes or no, and the according action is taken.

My problem is that when the database is empty, I have another message box come up saying that the database is empty and that there are no records. The problem is, the message box asking whether they are sure they want to delete still comes up, and should not come up in the instance that the database is empty.

Also, when the record deletes, and is at EOF, it is set to move previous, well if it is empty, it can not move to the previous record and results in an error message, how do I fix this?

Thank you
 
For the first problem I would disable the delete button if there are no records in the database. This will require a quick check. No point in allowing deletes if there is nothing to delete.

In the second problem check if BOF is true before a moveprevious is done. If BOF is true then don't moveprevious.

Thanks and Good Luck!

zemp
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top