Beginner's question

  • Thread starter Thread starter Sandro Fergnani
  • Start date Start date
S

Sandro Fergnani

Hi all and greetings from Italy !

I'm writing my first Access app and I have a question.

I have a button in my form that delete the current record. Since there is a
one to many relation between the table where the to be deleted record is
(the "one" side of the relationship) and another table (the "many" side of
the relation) I set the referential integrity checks on the relation itself.

Obviously when I delete a "father" record, Access warns me that all the
"childs" records in the other table will be deleted as well.

This is correct and it works fine.

I would like to trap the warning message that Access display and substitute
it with a message defined by me. I think that this should be possibile but I
wasn't able to find any trick about how to do it.

Any suggestion ?

Sandro

PS: please ignore my english errors.
 
I assume that you are doing this deletion with VBA code. You can use the
form's BeforeDelConfirm event to trap that message and to display your own
message:

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
' trap the normal ACCESS message
Response = acDataErrContinue
' display your message
MsgBox "Deleting other records...."
End Sub
 
Back
Top