[AccessD] BeforeUpdate v. AfterUpdate

Heenan, Lambert Lambert.Heenan at AIG.com
Tue May 20 16:20:30 CDT 2003


>From the (Access 97) Help file...

"Remarks

Microsoft Access uses the OldValue property to store the original value of a
bound control. When you edit a bound control on a form, your changes aren't
saved until you move to another record. The OldValue property contains the
unedited version of the underlying data."

So it's the act of moving away from the record, not the saving of it, that
wipes out OldValue.

> -----Original Message-----
> From:	Mark Whittinghill [SMTP:mwhittinghill at symphonyinfo.com]
> Sent:	Tuesday, May 20, 2003 12:12 PM
> To:	accessd at databaseadvisors.com
> Subject:	Re: [AccessD] BeforeUpdate v. AfterUpdate
> 
> That's interesting, because I use OldValue with AfterUpdate all the time,
> and it works just fine.
> 
> Mark Whittinghill
> Symphony Information Services
> 612-333-1311
> mwhittinghill at symphonyinfo.com
> ----- Original Message -----
> From: "John Colby" <jcolby at colbyconsulting.com>
> To: <accessd at databaseadvisors.com>
> Sent: Tuesday, May 20, 2003 7:39 AM
> Subject: RE: [AccessD] BeforeUpdate v. AfterUpdate
> 
> 
> > OldValue is set to Value when the data stores, thus by AfterUpdate the
> > OldValue data has indeed been lost.  Use BeforeUpdate to store the value
> to
> > a variable, then compare to that variable in AfterUpdate.
> >
> > John W. Colby
> > www.colbyconsulting.com
> >
> > -----Original Message-----
> > From: accessd-bounces at databaseadvisors.com
> > [mailto:accessd-bounces at databaseadvisors.com]On Behalf Of Arthur Fuller
> > Sent: Tuesday, May 20, 2003 9:29 AM
> > To: AccessD
> > Subject: [AccessD] BeforeUpdate v. AfterUpdate
> >
> >
> > >From my experiments, it appears that MyControl.OldValue is available
> for
> > scrutiny only in the BeforeUpdate event. In the AfterUpdate event it
> seems
> > to be lost. I just wanted to confirm this hypothesis.
> >
> > The point of the exercise is that I need to keep track of which columns
> a
> > user has changed and then take action accordingly. I have to update some
> > columns in another table depending on which columns changed in the
> current
> > table, but only if the update to the current table was successul. I
> don't
> > actually care about the old value, I'm just using it to determine which
> > columns changed. But by the time I get to AfterUpdate I've lost the
> > information.
> >
> > Any suggestions as to how to work around this?
> >
> > TIA,
> > Arthur
> >
> > _______________________________________________
> > 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