I need to be able to disable the "x" the close button in the upper right-hand corner of my dialog box screen; anyone know the code for this or how to do it?

what happenes is that i have a cancel button to go back to main program and it closes w/o updating the record; however if the user happens to use the "x" instead of cancel the record will update and that leaves a blank or inaccurate record in the database.

any help would be greatly appreciated, thanks!!!