Update Forms into Table

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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]...
 
Back
Top