J
Jason Jiang
I add the following codes in BeforeUpdate event. When I click the Close
botton (X) in the right top of the form, it will let me choose if I wanna
save or discharge or cancel. When I clikc the cancel botton, it always shows
"You cannot save this records.....". How can I realize this fucntion
smoothly?
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty = True Then
Select Case MsgBox("Click YES, Save and Close; Clikc NO, discharge
and Close; Click Cancel, Don't save and Don't close", vbYesNoCancel)
Case vbYes
Save = True
Case vbNo
Me.Undo
Case vbCancel
Cancel = -1
End Select
End If
End Sub
botton (X) in the right top of the form, it will let me choose if I wanna
save or discharge or cancel. When I clikc the cancel botton, it always shows
"You cannot save this records.....". How can I realize this fucntion
smoothly?
Private Sub Form_BeforeUpdate(Cancel As Integer)
If Me.Dirty = True Then
Select Case MsgBox("Click YES, Save and Close; Clikc NO, discharge
and Close; Click Cancel, Don't save and Don't close", vbYesNoCancel)
Case vbYes
Save = True
Case vbNo
Me.Undo
Case vbCancel
Cancel = -1
End Select
End If
End Sub