RE: Updateing data when closing forms
- From: "Linq Adams via AccessMonster.com" <u28780@uwe>
- Date: Sat, 06 Oct 2007 03:38:40 GMT
I'm guessing your close button uses DoCmd>close. It has long been recommended
that the code
If Me.Dirty Then Me.Dirty = False
be inserted before using
DoCmd.Close
to close a form because of a quirk in Access. When DoCmd.Close is used,
Access closes the form regardless of whether a validation rule or required
field rule has been violated! If one of these rules has been violated, Access
will simply dump the record, close the form, and not tell the user that the
record has been dumped!
Using
If Me.Dirty Then Me.Dirty = False
forces Access to attempt to save the record, and if a violation has occurred,
will throw up a warning message allowing correction to be made before closing
the form.
--
There's ALWAYS more than one way to skin a cat!
Answers/posts based on Access 2000
Message posted via http://www.accessmonster.com
.
- Prev by Date: Re: Adding workdays to a date
- Next by Date: Re: multiple check boxes
- Previous by thread: Adding workdays to a date
- Next by thread: Re: Writing record to a table from a form
- Index(es):