I am trying to run this code below in an after update only if the user clicks on the cancel button. What code do I need to write so I know when the user clicks the cancel button only then the below code will run. HELP!
DoCmd.SetWarnings False 'this gets rid of the standard msgbox from appearing.
DoCmd.RunSQL "delete from tblClinician where ClinicianID = " & Me.ClinicianID
DoCmd.SetWarnings True
Me.Requery 'This code is now on the form after update property
DoCmd.Close acForm, "frmAddClinician", acNormal
DoCmd.OpenForm "frmSwitchboard", acNormal
Regards
Ritesh