Use the BeforeUpdate event of the form/subform to set your date/time
values.
On my website, I have a small downloadable app that utilizes DOC
(DateOfCreation) and DOLE (DateOfLastEdit).
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions
>I have a form 'klaarzetten' in which I want to track changes made on
> the form.The form contains two subforms.
[quoted text clipped - 10 lines]
> is written and causes a lot of unwanted data traffic.
> What is the best solution to this problem?
Use the BeforeUpdate event of the *form* (not controls).
This is the last moment to write the date and user name before the record is
saved.
There is no point dirtying the record again immediately after the save (as
Form_AfterUpdate does), because you then need to save again, which triggers
the event again, and so you need to save again, and ...

Signature
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.
>I have a form 'klaarzetten' in which I want to track changes made on
> the form.The form contains two subforms.
[quoted text clipped - 10 lines]
> is written and causes a lot of unwanted data traffic.
> What is the best solution to this problem?
Rhetta75069 - 21 Oct 2005 14:33 GMT
Would this same principle work when you want to track a "Status Change" to a
record? Can you set it to record the prior status and the date it was
changed?
> Use the BeforeUpdate event of the *form* (not controls).
>
[quoted text clipped - 19 lines]
> > is written and causes a lot of unwanted data traffic.
> > What is the best solution to this problem?
Allen Browne - 22 Oct 2005 15:09 GMT
If you are trying to log changes to another table, then you want to write
them only in Form_AfterUpdate, when you know for sure the change succeeded.
But the OldValue is not available then, so you need to save it somewhere
(variable or temp table) in Form_BeforeUpdate, so you have it in
Form_AfterUpdate.
If you are also trying to record deletions, things get more involved. For
details, see:
Audit Trail - Log changes at the record level
at:
http://allenbrowne.com/AppAudit.html

Signature
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.
> Would this same principle work when you want to track a "Status Change" to
> a
[quoted text clipped - 27 lines]
>> > is written and causes a lot of unwanted data traffic.
>> > What is the best solution to this problem?