General discussion

Locked

Microsoft Access 2000

By Mair ·
I have developed a database but in that dbase there are two fields one is date of birth and the other is age. My questions is how do I get the date of birth to automatically update the age field ?

This conversation is currently closed to new comments.

5 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

Microsoft Access 2000

by DKlippert In reply to Microsoft Access 2000

Calculated fields should not be included in Tables. Base your report on a Query and use something like (Date()-[BirthDate])/365

Collapse -

Microsoft Access 2000

by Mair In reply to Microsoft Access 2000

Poster rated this answer

Collapse -

Microsoft Access 2000

by brent.brewer In reply to Microsoft Access 2000

Since the age changes as time goes on, it would be better to not store the age in the table but set a text field to have the Control Source =Int((Date()-[Birthdate])/365). you would also use this in your reports. Make sure you have the '=' sign in front of the equation. This will allow it to show current age on the report and in the form.

Alternate way to get same result
=Int((DateDiff("d",[Birthdate],Date()))/365)

Collapse -

Microsoft Access 2000

by Mair In reply to Microsoft Access 2000

Poster rated this answer

Collapse -

Microsoft Access 2000

by Mair In reply to Microsoft Access 2000

This question was closed by the author

Back to Web Development Forum
5 total posts (Page 1 of 1)  

Related Discussions

Related Forums