| re: store time and date
"DeanL" <deanpmlonghurst@yahoo.com> wrote in
news:1142461308.570846.275440@v46g2000cwv.googlegr oups.com:
[color=blue]
> Depending on where you store that information (I created a
> field in a relevant table), I used the AfterUpdate event to
> store the current system date/time in the field as follows:
>
> AfterUpdate
>
> txtBoxForUpdateDate = Now
>
> I've used this to keep track of when the relevant
> fields/records were last updated. If you only want the date
> recorded for the first time a record is created/saved then
> some code would be needed to check if the field value is null
> before updating. Unfortunately, I'm not 100% up on that one
> so maybe someone else could assist in that area.
>
> All the best, Dean...
>
>[/color]
You don't want to use the afterupdate event for this, but the
form's before update. Before occurs just before the entries are
save to the table, the other after. You avoid writing twice with
the before_update. I actually have two fields in the database,
one entitled CreationStamp, the other EditedStamp.
If me.newrecord then
me.creationStamp = now()
else
me.EditedStamp = now()
end if
--
Bob Quintal
PA is y I've altered my email address. |