[AccessD] DirtyFalse Procedure (was Dirty property)

Susan Harkins ssharkins at gmail.com
Thu Jul 23 10:53:44 CDT 2015


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
>


More information about the AccessD mailing list