Hi, I've found lots of info, here & elsewhere, on age calculation from a DOB field - however, very little detailed and precise instructions as to how to make it all work !
I've found the following code on here:
Age: DateDiff("yyyy",[DOB],Date())+(Date()<DateSerial(Year(Date()),Month([DOB]),Day([DOB])))
I have a Form with a DOB field linked (bound) to a Table. On the Form I also have an un-bound Text Box called Age (I'm deliberately ommitting any " " so as to avoid any confusion in the code).
I know not to store the calculated age in the Table, hence the un-bound box.
Could someone please explain precisely how & where I enter this code on the Form to get the Age field to automatically show the precise age (YYMM) or (YYMMDD) upon opening the Form e.g.
Design View/Property Sheet/ Tab?/etc.
If not obvious, it may be useful to know whether this is a Macro, or VBA Code or an Expression ? Many of the solutions I've looked at aren't clear on this point.
Many Thanks in anticipation
Negger
I've found the following code on here:
Age: DateDiff("yyyy",[DOB],Date())+(Date()<DateSerial(Year(Date()),Month([DOB]),Day([DOB])))
I have a Form with a DOB field linked (bound) to a Table. On the Form I also have an un-bound Text Box called Age (I'm deliberately ommitting any " " so as to avoid any confusion in the code).
I know not to store the calculated age in the Table, hence the un-bound box.
Could someone please explain precisely how & where I enter this code on the Form to get the Age field to automatically show the precise age (YYMM) or (YYMMDD) upon opening the Form e.g.
Design View/Property Sheet/ Tab?/etc.
If not obvious, it may be useful to know whether this is a Macro, or VBA Code or an Expression ? Many of the solutions I've looked at aren't clear on this point.
Many Thanks in anticipation
Negger