Connecting Tech Pros Worldwide Forums | Help | Site Map

creation and update times

Mark
Guest
 
Posts: n/a
#1: Nov 12 '05
Hi all,
I am trying to add 4 fields to an existing table which will show record
creation date and time and record update date and time. I have managed to do
the creation date and time ok by adding a default value to the fields on the
form of =Now(). My problem begins when I try to get the updated field filled
in automatically. I just can't think how to do it.

Many thanks in advance for any suggestions

Mark



Mark
Guest
 
Posts: n/a
#2: Nov 12 '05

re: creation and update times


Following on from my previous post. I have come up with the idea to add a
default value of Now() to the updated fields. Then set a rule to every other
field so that after update, run a query which updates the fields to Now().
My new problem is that I don't now how to set the criteria on the update
query so it only updates the current record!!!

Is this the right way to go? Is there a better/easier way to achieve this?

Mark

P.S. I know absolutely nothing about VB!!!!!


"Mark" <mark.reed75@ntlworld.com> wrote in message
news:A3oRb.30598$OA3.10620644@newsfep2-win.server.ntli.net...[color=blue]
> Hi all,
> I am trying to add 4 fields to an existing table which will show[/color]
record[color=blue]
> creation date and time and record update date and time. I have managed to[/color]
do[color=blue]
> the creation date and time ok by adding a default value to the fields on[/color]
the[color=blue]
> form of =Now(). My problem begins when I try to get the updated field[/color]
filled[color=blue]
> in automatically. I just can't think how to do it.
>
> Many thanks in advance for any suggestions
>
> Mark
>
>[/color]


NeilAnderson
Guest
 
Posts: n/a
#3: Nov 12 '05

re: creation and update times


Attach a procedure to the form's before update event like this. Must
be before otherwise it will cascade.

me![fieldName] = now()

By the way you only need 2 fields if you are using now(). If you need
the date use date(fieldName), if you need the time use
time(fieldName).

neil
NeilAnderson
Guest
 
Posts: n/a
#4: Nov 12 '05

re: creation and update times


Sorry, it should be format([fieldname],"short date") &
format([fieldname],"short time") .

Neil
Closed Thread