Selasa, 02 Oktober 2012

[MS_AccessPros] Prompt user whether they want to save changes when the form's close

 

I have been trying to display a message to ask the user whether they want to save changes they made to the record, before they close the form. I stepped through the Form_Close event, but the If Me.Dirty stament has never become true after the data in a control (text box) was changed? Why is that?

Private Sub Form_Close()
If Me.Dirty Then
Call Response
End If
End Sub

Sub Response()
intResponse = MsgBox("Save changes? Yes/No", vbYesNo, "Save Record")
If intResponse = vbYes Then
Call SaveChanges
ElseIf intReply = vbNo Then
Call UndoTyping
End If
End Sub

__._,_.___
Recent Activity:
.

__,_._,___

Tidak ada komentar:

Posting Komentar