Care to post your function?
Normally, if you want to pass multiple values into a function you will use a
paramArray to get the values and then step through the array of values
If you have done that then you would call the function with
MyFunction("Open","Closed")
For example, this function returns the average of the values passed in.
Public Function fRowAverage(ParamArray Values())
'John Spencer UMBC CHPDM
'Last Update: April 5, 2000
'Calculates the arithmetic average (mean) of a group of values passed to it.
'Sample call:
'myAvg = fRowAverage("1","TEST","2", "3",4,5,6,0) returns 3 (21/7)
'Ignores values that cannot be treated as numbers.
'
' Max of 29 arguments can be passed to a function in Access SQL
Dim i As Integer, intElementCount As Integer, dblSum As Double
intElementCount = 0
dblSum = 0
For i = LBound(Values) To UBound(Values)
If IsNumeric(Values(i)) Then 'Ignore Non-numeric values
dblSum = dblSum + Values(i)
intElementCount = intElementCount + 1
End If
Next i
If intElementCount > 0 Then 'At least one number in the group of values
fRowAverage = dblSum / intElementCount
Else 'No number in the group of values
fRowAverage = Null
End If
End Function
John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County