Trapping messages with code

T

Tony Williams

How do I trap Access messages with code and substitute my own? I am trying
to work out how to trap the delete record confirmation messages, the one
that asks the user if they are sure and then the one that mentions other
tables where there is a relationship. These are not user friendly and I want
to put my own messages there. I know I can stop them altogether from
Tools/Options but I don't want to stop all messages.
Anyone help?
PS I'm a newbie at VBA so I would be grateful for easy steps please

Tony Williams
 
P

PC Datasheet

DoCmd.SetWarnings False
Msgbox "Your message"
<<Your delete Code>>
DoCmd.SetWarnings True
 
T

Tony Williams

Thanks for that does this code in the on load event of every form?
TIA
Tony
 
T

Tony Williams

Sorry figured it out I've put it in the procedure behind the delete button!
Obvious really.
Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top