Thanks for the quick response,Even when i click cancel, it still runs the scrpt.Any idea's?EDITED: I changed the code to this, it now works but it returns a 3, not a 4 for yes. am i loosing my mind?varret = xfa.host.messageBox("This will delete all data currently in this form. Continue?" , "Confirm...