It sounds to me like your simply looking for an event that fires when referential integrity is activated to present the user with a custom error message?
Take a look at the following code and play with it. When it tries to delete a record and fails it will cause an error, the error handling will spit out a message w/ the error code and error description. In your case, an error caused by trying to break integrity would look like "Error #3200 - The record cannot be deleted or changed because table 'RELATED TABLE NAME' includes related records."
You can use Err.Number to test for error # 3200 and give the user your custom message.
Code:
Private Sub cmdDelete_Click()
On Error GoTo ErrHandler
CurrentDb.Execute "DELETE FROM Table1 WHERE ID=" & Me!ID, dbFailOnError
Me.Requery
ExitHandler:
Exit Sub
ErrHandler:
MsgBox "Error #" & Err.Number & " - " & Err.Description
Resume ExitHandler
End Sub
Note: You asked for a way to test if it's going to fail before executing the code. This does not do that and only activates after the code has failed. If you really need to predict if it will fail or not then you can just a dlookup or dcount on each of the related tables to find related records. If dlookup or dcount returns records you know the delete will fail. This could obviously be tedious to code if you have a ton of related tables to check.