dom_donald
Registered User.
- Local time
- Today, 06:25
- Joined
- Apr 30, 2004
- Messages
- 22
Hi,
I've searched the forums but can't find the specific answer I'm looking for - so i apologise if someone else can find it!
I've got a db with various relationships that enforce referential integrity. It works fine.. until the point where I try to delete a record from a table using VB code (Recordset.Delete method).
Quite rightly i'm prevented from deleting a particular record, and the default error box is displayed, but this is (a) not meaningful to the average user and (b) the options on the box by default are 'end' and 'debug'.
I would like to trap the error and display a programmer-defined msgbox instead.
I've tried using the 'on error' block to trap the error number, but the automatic error seems to occur before this point. The last thing I want to have to do is trawl around the database checking for related records in the code, before attempting to delete a record.
Help!

I've searched the forums but can't find the specific answer I'm looking for - so i apologise if someone else can find it!
I've got a db with various relationships that enforce referential integrity. It works fine.. until the point where I try to delete a record from a table using VB code (Recordset.Delete method).
Quite rightly i'm prevented from deleting a particular record, and the default error box is displayed, but this is (a) not meaningful to the average user and (b) the options on the box by default are 'end' and 'debug'.
I would like to trap the error and display a programmer-defined msgbox instead.
I've tried using the 'on error' block to trap the error number, but the automatic error seems to occur before this point. The last thing I want to have to do is trawl around the database checking for related records in the code, before attempting to delete a record.
Help!

