[AccessD] DirtyFalse Procedure (was Dirty property)

Bill Benson bensonforums at gmail.com
Thu Jul 23 12:51:41 CDT 2015


Why would you want to do this when the issue was trying to *NOT* save the
file (ie, update any records) - on closing? What am I missing friends?

On Thu, Jul 23, 2015 at 11:53 AM, Susan Harkins <ssharkins at gmail.com> wrote:

> Thanks. :) For me, I think the question is knowing when to call it. :) When
> the place gets quiet this afternoon, I'll definitely try this.
>
> Susan H.
>
>
> A while back I learned that I could call:
> >
> >     Me.Dirty = False
> >
> > to save the current record in a bound form.
> >
> > This became a procedure in a module:
> >
> > ____________________________________
> > Public Sub DirtyFalse(frm As Form)
> >
> >     '-- Purpose:  This is called by any form to update all data to
> > underlying tables
> >
> >     If frm.RecordSource <> "" Then
> >         If frm.Dirty = True Then frm.Dirty = False
> >     End If
> >
> > End Sub
> > ____________________________________
> >
> > I typically call this in a form like this:
> >
> >     Call DirtyFalse(Me)
> >
> > This gives me some control over saving data at desirable points in
> > executing
> > code.  I use this frequently throughout my form's code.
> >
> > It also avoids an error if the form's recordset happens to not exist at
> the
> > time, and only sends data to the table if the form is already Dirty.
> >
> > HTH,
> > Dan
> >
> >
> > --
> > AccessD mailing list
> > AccessD at databaseadvisors.com
> > http://databaseadvisors.com/mailman/listinfo/accessd
> > Website: http://www.databaseadvisors.com
> >
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>


More information about the AccessD mailing list