You know when you close a window in word or something, it ask you if you want to save, and it say yes, no and cancel, how do i do that?
Printable View
You know when you close a window in word or something, it ask you if you want to save, and it say yes, no and cancel, how do i do that?
Put this at the beginning:
and this in EVERY save command inside a successful save:Code:Public Saved As Boolean
also:Code:Saved = True
:) :) :)Code:Private Sub Control_Change()
Saved = False
End Sub
Private Sub Form_QueryUnload(Cancel As Boolean)
Dim x As Integer
If Saved = False Then
x = MsgBox("Do you want to save before closing?", vbExclaimation + vbYesNoCancel)
If x = vbYes then
mnuSave_Click (or another saving proc)
Saved = True
End If
End If
If x = vbCancel Then Cancel = True
End Sub