Connecting Tech Pros Worldwide Forums | Help | Site Map

How to keep track of data changes (best way..)

Uwe Range
Guest
 
Posts: n/a
#1: Nov 13 '05
Hi to all,

I am developing a database where, with time, it proved to be necessary
to keep track of the changes to the data. It is fairly easy to keep
track of the time when a record was changed (afterupdate event)

-> Is there there a smart way of finding out which field has been
changed? I don't want to set a procedure on every field on the edit
form for keeping track of that, because the forms will be changed from
time to time.

Thanks in advance!

Uwe

Allen Browne
Guest
 
Posts: n/a
#2: Nov 13 '05

re: How to keep track of data changes (best way..)


Use the BeforeUpdate event of the form, not its AfterUpdate event. There is
no point in dirtying the record again immediately after is is saved.

When you use Form_BeforeUpdate, you can also compare the Value of each bound
control to its OldValue, to pick up the differences.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Uwe Range" <urange@gmx.de> wrote in message
news:641c90f5.0412140220.4a2a652c@posting.google.c om...[color=blue]
>
> I am developing a database where, with time, it proved to be necessary
> to keep track of the changes to the data. It is fairly easy to keep
> track of the time when a record was changed (afterupdate event)
>
> -> Is there there a smart way of finding out which field has been
> changed? I don't want to set a procedure on every field on the edit
> form for keeping track of that, because the forms will be changed from
> time to time.
>
> Thanks in advance!
>
> Uwe[/color]


Bas Cost Budde
Guest
 
Posts: n/a
#3: Nov 13 '05

re: How to keep track of data changes (best way..)


Uwe Range wrote:[color=blue]
> Hi to all,
>
> I am developing a database where, with time, it proved to be necessary
> to keep track of the changes to the data. It is fairly easy to keep
> track of the time when a record was changed (afterupdate event)
>
> -> Is there there a smart way of finding out which field has been
> changed? I don't want to set a procedure on every field on the edit
> form for keeping track of that, because the forms will be changed from
> time to time.[/color]

You can loop the Controls collection of a form; every control that has a
controlsource property also has an OldValue property. If that is not
equal to its Value, the control has changed.

--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
I prefer human mail above automated so in my address
replace the queue with a tea
Closed Thread