[AccessD] Dirty property

Susan Harkins ssharkins at gmail.com
Wed Jul 22 20:58:10 CDT 2015


Well, the form has a Save button that works just fine. I was only trying to
catch a specific business rule when using the Close button -- and I can
eliminate the whole problem by disabling the Close button. I think, given
the extra work, it's the best option. :)

Thanks guys!

Susan H.

On Wed, Jul 22, 2015 at 9:54 PM, Bill Benson <bensonforums at gmail.com> wrote:

> True Darryl, from my limited testing. When closing the form, the only
> chance you have to intercept the saving of any information which may have
> changed in a bound control is the form's Before_Update event. However, that
> is the same event you would use to validate changes were the user to click
> Save. and you don't really know, is the user Saving or are they Closing,
> because neither Form_Unload not Form_Close has yet fired, and Access does
> not have a QueryClose (and even if it did, Before_Update would probably
> fire first." Of course if you have a specific Save command button, you can
> set a flag UserSaving so bypass the message about losing changes from
> closing the form - but then the user could go ahead and click the Save icon
> on the menu, and then where are ya? There is no Form_BeingSaved event. It's
> a nightmare. SAVVVVEEEE MEEEEE from bound controls!
>
> On Wed, Jul 22, 2015 at 7:46 PM, Darryl Collins <
> darryl at whittleconsulting.com.au> wrote:
>
> > This is why you want to use unbound controls, as they behave as the user
> > would expect - not as the database does.  When a user 'cancels' a form
> they
> > expect the record to be dropped.  This is not the case when using a bound
> > form.
> >
> > Naturally this topic (bound/unbound) often ignites a firefight - so sorry
> > for bringing it up, but that is my experience and one of the many
> reasons I
> > use unbound forms.
> >
> > Cheers
> > Darryl.
> >
> > -----Original Message-----
> > From: AccessD [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of
> > Susan Harkins
> > Sent: Thursday, 23 July 2015 8:52 AM
> > To: Access Developers discussion and problem solving
> > Subject: Re: [AccessD] Dirty property
> >
> > So, usurping the form's Close event doesn't keep it from saving -- that's
> > confusing to me. What am I missing? Why would the Close button save the
> > record? I expect it to prompt me, not automatically save.
> >
> > Susan H.
> >
> > On Wed, Jul 22, 2015 at 6:23 PM, Steve Schapel <
> > steve at datamanagementsolutions.biz> wrote:
> >
> > > Well, if you are testing for the value of the Dirty property, the new
> > > record will have already been saved/committed by the time you get to
> > > the form's Close event, so yes, I would expect it to be False at that
> > point.
> > >
> > > Regards
> > > Steve
> > >
> > > -----Original Message----- From: Susan Harkins
> > > Sent: Thursday, July 23, 2015 9:54 AM
> > > To: Access Developers discussion and problem solving
> > > Subject: Re: [AccessD] Dirty property
> > >
> > >
> > >> Both, but specifically in this case, I'm talking about the Close
> > >> button at the top-right of the form. It seems easier to just remove
> > >> those. :)
> > >>
> > >>
> > > Susan H.
> > >
> > >
> > >> "The code behind that event uses Me.Dirty to check for any new
> values."
> > >>
> > >> What event are you referring to?  Do you have a command button on the
> > >> form, and you are looking at the Click event of the button?  Or do
> > >> you mean the form's built-in [x] close button, and you are looking at
> > >> the form's Close event?  Or something else?
> > >>
> > >> Regards
> > >> Steve
> > >>
> > >>
> > >>  --
> > > 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
> >
> --
> 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