as i knew, access will save the changes we made just by closing the form. it is automatically save right. my problem is let say i have a form that have button cancel, when i click that button, the changes i made will not be saved and the form will be closed, how on earth i'll be able to do that, to turn off the automatically save, thank you in advanced
R. Hicks
08-07-2000, 04:22 AM
Use this command in the On Click event of your Cancel button:
Me.Undo
You may want to add a message box to let the user know what is happening and give them an option to cancel out of the operation.
Private Sub cmdCancel_Click()
Dim strMsg As String, strTitle As String
Dim intResponse As Integer
strMsg = "You Chose to Cancel This Entry." & vbNewLine & vbNewLine & _
" Are You Sure?"
strTitle = "Are You Sure?"
intResponse = MsgBox(strMsg, vbQuestion + vbYesNo, strTitle)
If intResponse = vbYes Then
Me.Undo
DoCmd.OpenForm "Open The Next Form"
DoCmd.Close acForm, Me.Name
End If
End Sub
HTH
RDH
thank you very much.....it works....