Functions....multiple reports

  • Thread starter Thread starter jake
  • Start date Start date
J

jake

my database has 4 reports that I need to calculate the age of a person.
I now use:
Public Function Age()
If Month([DeathDate]) < Month([Birthdate]) Or _
(Month([DeathDate]) = Month([Birthdate]) And Day([DeathDate]) <
Day([Birthdate])) Then
Age = Year([DeathDate]) - Year([Birthdate]) - 1
Else
Age = Year([DeathDate]) - Year([Birthdate])
End If
End Function

in each report. My qestion, should i use the above code in each report
or is there a more effecient way?

Thanks,
Jake
 
Create a function in a module, and you'll be able to call it from all of
your reports.
 
I keep getting an error when I do this.... do I have to declare the
varibles? and if so - as what? Please forgive me, I 'm just learning
this aspect of access

Thanks, Jake
 
Back
Top