commitonclose property

  • Thread starter Thread starter Karen
  • Start date Start date
K

Karen

I'm using Access 2002 and want to set the commitonclose property on some of
my forms to '0'. According to the help file

"Returns or sets a Byte indicating whether the specified form saves changed
records when the form closes. Read/write.
Remarks
The value of the CommitOnClose property can be one of the following.

Setting Description
0 Closing the form discards any unsaved changes.
1 (Default) Closing the form saves any unsaved changes on the form.
2 Closing the form causes Microsoft Access to prompt the user whether
to save changes.

This property can only be changed during design time. During run time, it is
read-only."



The help file does not explain where or how to set the property.

I tried doing the following in the On Open Event of one form:

[frm edit reagent].commitonclose = 0

but this only gave me an error. I don't see the property in the properties
window.

Does anyone know how to do this?

Thanks for your help

Karen
 
That's a really bad thing.

Do you have any suggestions of how I can close a form without writing the
changes to the table? I'm trying to make a 'Cancel' button.

Karen
 
Cancel the form's BeforeUpdate event.

That's the only way you can be sure the catch the record regardless of how
it is about to be saved.
 
Back
Top