Update Forms into Table

G

Guest

I have created a field in Table as Date_of_Birth and Age and the same has
been created in form also.

I am entering date of birth in Form as example 14/01/1986 and in Age in
Control Source as like this =DateDiff("yyyy",[Date_of_Birth],Date()). Now the
age is visible in Form as 20 and it is not taking into Table or Query. Is
there any method available to take it…Please help me.
 
A

Allen Browne

Hi Siva

The first issue is that you must not store the Age in your table. Instead,
get Access to calculate it when needed. If you store it, you are creating a
maintenance nightmare for yourself: if you have more than 365 people, your
table will have bad data every day! Remove the Age field from your table.

The second issue is that DateDiff() only handles the difference in whole
years, so is not suitable. For a more detailed explanation of this an other
unsuccessful approaches, and an example of how to calculate the age
correctly, see:
http://allenbrowne.com/func-08.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

message
news:[email protected]...
 

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

Similar Threads

Coping with empty field 2
Update Querry 1
Managing Age Junior/Adult 2
can't search 2
Calculating Age 2
Dcount Problem? 1
Calculated Field - newbie question. 6
Syntax for age in a form 2

Top