Hi,
I have a standard delete button on a data input form. I have cascading delete enabled one some relationships but not on all. In order to display my own custom delete message i have used..
DoCmd.SetWarnings False
...so as not to display the access warning messages when deleting records. This is fine when i am deleting a record that is related to tables that i am allowing deletes to cascade to. However when i try to delete a record that has related data in a table which i dont want to cascade deletes to i get the following message...
"The record cannot be delete because the table 'x' includes related records"
...Ideally what I would like to do is capture the error here and display a custom message to the user. However when i use MsgBox DataErr no error code is present. It seems that this message is neither a warning or an error????????!!!!
Any help with this would be much appreciated.
I have a standard delete button on a data input form. I have cascading delete enabled one some relationships but not on all. In order to display my own custom delete message i have used..
DoCmd.SetWarnings False
...so as not to display the access warning messages when deleting records. This is fine when i am deleting a record that is related to tables that i am allowing deletes to cascade to. However when i try to delete a record that has related data in a table which i dont want to cascade deletes to i get the following message...
"The record cannot be delete because the table 'x' includes related records"
...Ideally what I would like to do is capture the error here and display a custom message to the user. However when i use MsgBox DataErr no error code is present. It seems that this message is neither a warning or an error????????!!!!
Any help with this would be much appreciated.