Need to have a date field updated to today if diff field of record chgd.

C

Carrie

Automatic update of a date field to today... Inserting
records works terrific; how do I do it for an updated
record? I have a form displaying one record at a time.
The user can change various fields but rather than
requiring her to change the 'date keyed' field ALSO (she
forgets), I would love to have it change to 'today'
automatically. When I attempted to code using some such
field property, I updated EVERY record in my table. NOT
GOOD. Do I need a VB command or can this be done easily
in Access? (Access 97)
 
C

Carrie

Pardon my ignorance of your reference... What
does 'Me.dirty' mean? If EMPL_MASTER.? then
[EMPL_MASTER]![EFFDT]=Now()
 
M

Mike Painter

In the BeforeUpdate field of the form.
If Me.dirty then
me!yourDateField = Now()
end if

This will work *even* if something is changed, then changed back.
Usually not a problem and a lot of work if it won't do.
 
C

Carrie

Thanks - I think I got it.
-----Original Message-----
In the BeforeUpdate field of the form.
If Me.dirty then
me!yourDateField = Now()
end if

This will work *even* if something is changed, then changed back.
Usually not a problem and a lot of work if it won't do.




.
 
Y

Yair Sageev

The easiest way to do this is to open the properties for that field and
cursor over to the "default value" field. Browse, scroll down to
"functions".

Then scroll down to "built in functions". Select Date/Time.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top