Sub AnnéePersonne()
Dim StrCat$
If IsDate(TxtDateNaissance) = False Then
MsgBox " La date de naissance n'est pas correcte"
TxtDateNaissance = ""
Exit Sub
End If
datefin = CDate(LblSaison.Tag) 'On récupére la date
If IsDate(datefin) = False Then
MsgBox " La saison n'est pas saisie correctement"
Exit Sub
End If
datedébut = CDate(TxtDateNaissance)
datefin = CDate(datefin)
AnAdhérent = DateDiff("yyyy", datedébut, datefin, vbMonday, vbFirstFourDays)
Select Case AnAdhérent
Case Is <= 8
StrCat = "Poussin"
Case Is <= 10
StrCat = "Benjamin"
Case Is <= 12
StrCat = "Minime"
Case Is <= 14
StrCat = "Cadet"
Case Is <= 17
StrCat = "Junior"
Case Is <= 39
StrCat = "Senior"
Case Is > 39
StrCat = "Veteran"
End Select
TxtCategorie.Text = StrCat
End Sub