digitalxni
Registered User.
- Local time
- Today, 21:38
- Joined
- Nov 18, 2009
- Messages
- 42
Hey guys, I've got a module that reads a date of birth and puts it into the relevant age group which works fine except that I want to ignore all people over the age of 4 which is so simple yet I can't seem to do it!
Here is my function:
I tried using an If statement but that didn't seem to work
Any ideas?
Here is my function:
Code:
Public Function AgeGroup(DoB As Date) As String
Dim intAge As Integer
intAge = DateDiff("yyyy", [DoB], Now()) + Int(Format(Now(), "mmdd") < Format([DoB], "mmdd"))
Select Case intAge
Case Is < 1
AgeGroup = "A) Under 1"
Case 1
AgeGroup = "B) 1 Year"
Case 2
AgeGroup = "C) 2 Years"
Case 3
AgeGroup = "D) 3 Years"
Case 4
AgeGroup = "E) 4 Years"
End Select
End Function
I tried using an If statement but that didn't seem to work

Any ideas?