I have a delete query that runs off a button on a form. If the user types in the value of a record that can not be deleted due to referential integrity rules, I want a message of my own to come up that says they can't do it. I tried debug.print and got dataerr=8058 and then in the Form's OnError event I put an If statement that checks for that error number but I still get the key violation error message and I never see my own. Since the query runs off of a command button, I also put the If statment in the OnError event of the button but I still get the key violation message. Any ideas?????