Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

autoupdate

Status
Not open for further replies.

superhl

IS-IT--Management
Dec 16, 2001
20
0
0
US
Can someone help me resolve my autoupdate issue.
When I try to update the DOB/AGE, nothing happens.
It worked before upgrading to office 2000. thanks for
any help!!!!

Function Age(varBirthDate As Variant) As Integer
Dim varAge As Variant

If IsNull(varBirthDate) Then Age = 0: Exit Function
varAge = DateDiff("yyyy", varBirthDate, Now)
If Date < DateSerial(Year(Now), Month(varBirthDate), Day(varBirthDate)) Then
varAge = varAge - 1
End If
Age = CInt(varAge)
End Function

Function AgeMonths(ByVal StartDate As String) As Integer
Dim tAge As Double
tAge = (DateDiff(&quot;m&quot;, StartDate, Now))
If (DatePart(&quot;d&quot;, StartDate) > DatePart(&quot;d&quot;, Now)) Then
tAge = tAge - 1
End If

If tAge < 0 Then
tAge = tAge + 1
End If

AgeMonths = CInt(tAge Mod 12)
End Function

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top