D
Douglas J. Steele
If you want a value to be available in the function, you need to pass it
into the function.
Function GetGroup(DOB As Date) As String
Select Case DOB
Case #8/1/1989# To #7/31/1990#
FindGroup = "U15"
Case #8/1/1990# To #7/31/1991#
FindGroup = "U14"
Case Else
FindGroup = "Check DOB"
End Select
End Function
You then call that function as GetGroup(DATE_OF_BI)
If there's a possibility that DATE_OF_BI can be null, declare DOB in the
function as a Variant:
Function GetGroup(DOB As Variant) As String
into the function.
Function GetGroup(DOB As Date) As String
Select Case DOB
Case #8/1/1989# To #7/31/1990#
FindGroup = "U15"
Case #8/1/1990# To #7/31/1991#
FindGroup = "U14"
Case Else
FindGroup = "Check DOB"
End Select
End Function
You then call that function as GetGroup(DATE_OF_BI)
If there's a possibility that DATE_OF_BI can be null, declare DOB in the
function as a Variant:
Function GetGroup(DOB As Variant) As String