close form without saving

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I got Form created from Query and it collect informations, add it and in the
end of the Form there is three button( ADD , VIEW , EXIT ).
Everything is working great but only the Exit Button.let me explain:
I want when i click the exit button the following to happen:
(*) Close Form without saving any information.
NOTE: At the moment when i click the button it does close form but it saving.

Help me please.Thanks
Hassan Merzha
 
Hassan Wrote:
--------------------------
Hi
I got Form created from Query and it collect informations, add it and
in the end of the Form there is three button( ADD , VIEW , EXIT ).
Everything is working great but only the Exit Button.let me explain: I
want when i click the exit button the following to happen:
(*) Close Form without saving any information. NOTE: At the moment when
i click the button it does close form but it saving.

Help me please.Thanks
Hassan Merzha
-----------------------------------------------------
You want to be sure that your form is not bound to the underlying
table. If it isn't bound, then there would be no reason for the data
to be saved. Then you'd need do append the data when you click the
"ADD" button.

HTH-

Betsy
 
Saving the form or saving changes to the data?

If it is the form, you call tell it not to save any changes made to the form
in the Close method
DoCmd.Close acForm, "YourFormName", acSaveNo

If you want to close the form without saving changes to the current record,
before you close the form using the Exit button, do an Undo:

Me.UnDo
DoCmd.Close acForm, "YourFormName", acSaveNo

That will not prevent a user from closing the form another way. You may
want to put some some in the form's Close event to handle that.
 
Back
Top