Returning A value to a table

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
 
J

JJR

I have a simple select case statement I want to return a value to a table I
call Players. I evaluate a date range from the field DATE_OF_BI and I want
to have the FindGroup field to be passed the result. What am i doing wrong.
Thanks for any help.


Option Compare Database

Function GetGroup() As String
Select Case DATE_OF_BI
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top