I have a form with two fields: [DOB] (for date of birth) and [Age] (which is unbound). I'm using the following to calculate age:
[Age] = DateDiff("yyyy", [DOB], Date) + (Date < DateSerial(Year(Date), Month([DOB]), Day([DOB])))
My question is this: What's the best place to place this? If I place it on [DOB] (update or exit), [Age] does not change when I scroll through records. So I placed it on the form's "on timer" event with a timer inerval of 1000. This is better but I still get that split second delay in recalculating. This is OK if you visually start at the top of the form and work your way down, but if you're scrolling through records looking at ages, you can see it change. Any other place I can place this so that [Age] is calculated and displayed along with the rest of the data on the form as I scroll throught the records? Is there an event such as "on load record" or something?
TIA
[Age] = DateDiff("yyyy", [DOB], Date) + (Date < DateSerial(Year(Date), Month([DOB]), Day([DOB])))
My question is this: What's the best place to place this? If I place it on [DOB] (update or exit), [Age] does not change when I scroll through records. So I placed it on the form's "on timer" event with a timer inerval of 1000. This is better but I still get that split second delay in recalculating. This is OK if you visually start at the top of the form and work your way down, but if you're scrolling through records looking at ages, you can see it change. Any other place I can place this so that [Age] is calculated and displayed along with the rest of the data on the form as I scroll throught the records? Is there an event such as "on load record" or something?
TIA