VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Calculates a persons age.

by Murray Reed (1 Submission)
Category: Miscellaneous
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 1st September 2001
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Calculates a persons age.

Rate Calculates a persons age.



Dim intAge As Integer
Dim datThisYearsBirthday As Date

datDateOfBirth = Format(datDateOfBirth, "mm/dd/yyyy") 'Standardize Input

datThisYearsBirthday = Left(datDateOfBirth, 5) 'Year defaults to current year

intAge = DateDiff("yyyy", datDateOfBirth, Now)

If Now < datThisYearsBirthday Then intAge = intAge - 1

CalculateAge = intAge

End Function

Download this snippet    Add to My Saved Code

Calculates a persons age. Comments

No comments have been posted about Calculates a persons age.. Why not be the first to post a comment about Calculates a persons age..

Post your comment

Subject:
Message:
0/1000 characters