H
HD87glide
Hello Group! I am looking for some help. In researching a problem I found a
post that had some code for a function. When I built the function and
modified the code to produce what I needed and use the 'debug' feature it
seems to work, but the values are not produced on my form.
The function should take a group of numbers and return the smallest number
in the array. An example would be:
LowestValue (1, 10, 100, 1000, 10000)
Function LowestValue(ParamArray LowArray() As Variant)
Dim dtmLowestValue As Integer
Dim intLoop As Integer
dtmLowestValue = LowArray(0)
For intLoop = 1 To UBound(LowArray())
If IsNull(LowArray(intLoop)) = False Then
If LowArray(intLoop) < dtmLowestValue Then
dtmLowestValue = LowArray(intLoop)
End If
Else
Exit For
End If
Next intLoop
End Function
The function seems to run as I can walk through it with debug and can see
the values change. How do I get the final value to show up on my form? The
input numbers for the function will be calculated from other fields on the
form so I cannot use a table to produce the results.
Thanks for your help!
Jeff
post that had some code for a function. When I built the function and
modified the code to produce what I needed and use the 'debug' feature it
seems to work, but the values are not produced on my form.
The function should take a group of numbers and return the smallest number
in the array. An example would be:
LowestValue (1, 10, 100, 1000, 10000)
Function LowestValue(ParamArray LowArray() As Variant)
Dim dtmLowestValue As Integer
Dim intLoop As Integer
dtmLowestValue = LowArray(0)
For intLoop = 1 To UBound(LowArray())
If IsNull(LowArray(intLoop)) = False Then
If LowArray(intLoop) < dtmLowestValue Then
dtmLowestValue = LowArray(intLoop)
End If
Else
Exit For
End If
Next intLoop
End Function
The function seems to run as I can walk through it with debug and can see
the values change. How do I get the final value to show up on my form? The
input numbers for the function will be calculated from other fields on the
form so I cannot use a table to produce the results.
Thanks for your help!
Jeff