I currently have your basic If you want to close Yes\No setup.
If MsgBox("Are you sure you want to exit?", vbYesNo + vbQuestion, _
"Exit Dialog") = vbNo Then
Cancel = True
End If
But I am thinking that if the form has changes that the user should have option to save then or continue with closing the form. Not sure if this would cover that. If so, I believe above the exit dialog.
If Me.Dirty Then
If MsgBox("Do you want to Save?", vbYesNo + vbQuestion, "Save Record") = vbNo Then
Me.Undo
End If
TIA