C
CoachBarkerOJPW
RIght now in a form I have this calculation to find the date of birth. I
would like to replace the variable of current season with a selection from a
combo box (cboSeasonID)but can not seem to get it right. Any help would be
apppreciated.
Private Sub txtDateOfBirth_AfterUpdate()
'read in the birth date and the current season
Dim dateOfBirth As Date
Dim currentSeason As Date
' declare the variables
dateOfBirth = txtDateOfBirth.Value
currentSeason = txtCurrentSeason.Value
' calc the age
Dim PlayingAge As Integer
PlayingAge = DateDiff("yyyy", dateOfBirth, DateSerial(Year(Date), 8, 1) -
IIf(Format(dateOfBirth, "mmdd") < "0801", 1, 0)) - 1
' put the age on the form
txtPlayingAge.Value = PlayingAge
End Sub
Thanks
CoachBarkerOJPW
would like to replace the variable of current season with a selection from a
combo box (cboSeasonID)but can not seem to get it right. Any help would be
apppreciated.
Private Sub txtDateOfBirth_AfterUpdate()
'read in the birth date and the current season
Dim dateOfBirth As Date
Dim currentSeason As Date
' declare the variables
dateOfBirth = txtDateOfBirth.Value
currentSeason = txtCurrentSeason.Value
' calc the age
Dim PlayingAge As Integer
PlayingAge = DateDiff("yyyy", dateOfBirth, DateSerial(Year(Date), 8, 1) -
IIf(Format(dateOfBirth, "mmdd") < "0801", 1, 0)) - 1
' put the age on the form
txtPlayingAge.Value = PlayingAge
End Sub
Thanks
CoachBarkerOJPW