[AccessD] DirtyFalse Procedure (was Dirty property)

Bill Benson bensonforums at gmail.com
Thu Jul 23 15:27:43 CDT 2015


Well if  in this situation and they were closing the form before a record
was completed and you wanted to give them the opportunity to complete the
record rather than close out the form couldn't you still use the method but
in the former error event set a flag to check in the unload event?
Whereupon you could then offer the user the choice to stay or not. In the
former after update, set that flag false again.
On Jul 23, 2015 4:08 PM, "FW Salato Center" <Salato at ky.gov> wrote:

> It's not a question of not saving the current record. I'm making sure that
> one of those fields has a value when the user tries to save the record. If
> they use the close button to close the form, I don't want them saving when
> prompted without checking those fields.
>
> Susan H.
>
> 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
>
> --
> 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