Could someone explain to me how to create an autoupdate. I have a field "dob",
And I would like to update the the age the idividual. It worked before upgrading t
to office 2000. thanks
You can call this code in your on Current event that has the birthdate on the form
Public Function Age(BirthDate As Date) As Integer
'This Function Takes The Current Date and a Birthdate
'and compares the two to see if there is another year increased
'on the birthdate
Dim intTempAge As Integer
'set initial age
intTempAge = DateDiff("yyyy", BirthDate, Now())
'compare the month if it is this month or earlier then check the
'day if the day is the same day or any previous day then retain
'initial age else subtract one year from the initial age
If ((Month(BirthDate) = Month(Now())) And _
(Day(BirthDate) <= Day(Now()))) Or _
(Month(BirthDate) < Month(Now())) Then
Age = intTempAge
Else
Age = intTempAge - 1
End If
End Function
HTH
Dave
ToeShot@Hotmail.com
Today Is Tomorrows Yesterday. So Why Wait
The program continues not to update. Is there any way I could send this database as an attach in order for you to view. Thanks for any help. I have deleted all the important info and now consist of 6 rows.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.