[AccessD] DirtyFalse Procedure (was Dirty property)

Dan Waters df.waters at outlook.com
Thu Jul 23 13:47:36 CDT 2015


This just a related subject.

Dan

Sent from my Windows Phone
________________________________
From: Bill Benson<mailto:bensonforums at gmail.com>
Sent: ‎7/‎23/‎2015 12:54
To: Access Developers discussion and problem solving<mailto:accessd at databaseadvisors.com>
Subject: Re: [AccessD] DirtyFalse Procedure (was Dirty property)

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
>
--
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