G
Guest
I was using this function with Access 2000 and it was working fine; however,
I upgraded to Access 2003 and now it will not work. The Error message is
"The object doesn't contain the Automation object "MaxValueVariantArray."
You tried to run a VB procedure to set a property or method for an object.
However, the component doesn't make the property or method available for
automation operations. Can someone please assist. Thank you
Option Compare Database
Function MaxValueVariantArray(ParamArray ValuesArray() As Variant) As Variant
' ** THIS FUNCTION RETURNS THE MAXIMUM VALUE FROM AN ARRAY OF VALUES.
' Ken Snell 19 May 2005
Dim xlngLB As Long, xlngUB As Long, xlngCnt As Long
Dim xvarTp As Variant
xlngLB = LBound(ValuesArray)
xlngUB = UBound(ValuesArray)
If xlngUB >= 0 And xlngLB >= 0 Then
xvarTp = ValuesArray(xlngLB)
For xlngCnt = xlngLB + 1 To xlngUB
If ValuesArray(xlngCnt) > xvarTp Then xvarTp = ValuesArray(xlngCnt)
Next xlngCnt
End If
MaxValueVariantArray = xvarTp
End Function
I upgraded to Access 2003 and now it will not work. The Error message is
"The object doesn't contain the Automation object "MaxValueVariantArray."
You tried to run a VB procedure to set a property or method for an object.
However, the component doesn't make the property or method available for
automation operations. Can someone please assist. Thank you
Option Compare Database
Function MaxValueVariantArray(ParamArray ValuesArray() As Variant) As Variant
' ** THIS FUNCTION RETURNS THE MAXIMUM VALUE FROM AN ARRAY OF VALUES.
' Ken Snell 19 May 2005
Dim xlngLB As Long, xlngUB As Long, xlngCnt As Long
Dim xvarTp As Variant
xlngLB = LBound(ValuesArray)
xlngUB = UBound(ValuesArray)
If xlngUB >= 0 And xlngLB >= 0 Then
xvarTp = ValuesArray(xlngLB)
For xlngCnt = xlngLB + 1 To xlngUB
If ValuesArray(xlngCnt) > xvarTp Then xvarTp = ValuesArray(xlngCnt)
Next xlngCnt
End If
MaxValueVariantArray = xvarTp
End Function