Storing a date in a form (1 Viewer)

Jon K

Registered User.
Local time
Today, 20:18
Joined
May 22, 2002
Messages
2,209
I have a personnel database. I want to automatically update the age and years of service before the input/edit form is opened for the first time each day.

I am able to do this by storing the "last updated" date in a single row table and comparing today's date with this date each time the form is opened.

I am wondering if I can store this "last updated" date in the form itself instead of in a separate table.

Thanks for your help.
 

Jon K

Registered User.
Local time
Today, 20:18
Joined
May 22, 2002
Messages
2,209
llkhoutx,

Thanks for your quick response. Would you please tell me how to do it? Thanks.

Jon K
 

David R

I know a few things...
Local time
Today, 14:18
Joined
Oct 23, 2001
Messages
2,633
You cannot store anything in a form in the way of data, a form is simply a way to view table data. Rather than storing these two fields and running an Update Query every day, put them in the query that your form is based on, and they will always be up to date.

Age: DateDiff("y",[DOB],Date())
YearsService: DateDiff("y",[DateHired],Date())


[This message has been edited by David R (edited 05-28-2002).]
 
R

Rich

Guest
You could of course also use the formulas shown in unbound text boxes on a form, same result.
 

Jon K

Registered User.
Local time
Today, 20:18
Joined
May 22, 2002
Messages
2,209
David,
Rich,

Thank you very much for your helpful input.

Jon K
 

Users who are viewing this thread

Top Bottom