Max function???

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

how can i get the Maximun Value of a text control???
i.e. (This is on the control source of text4)
=max([text1],[text2],[text3])
but it only returns #error?
if i remove the (=)sign, it returns #name?
what is the best solution for this?
thanks in advance!!! have a nice day
 
ryan c said:
how can i get the Maximun Value of a text control???
i.e. (This is on the control source of text4)
=max([text1],[text2],[text3])
but it only returns #error?
if i remove the (=)sign, it returns #name?
what is the best solution for this?
thanks in advance!!! have a nice day

Max() does not work against a list of supplied arguments. It works against
a field in a query. For example...

SELECT Max(SomeField) FROM SomeTable

....evaluates the values of SomeField in al of the rows of SomeTable and
returns the largest value.

For your situation you would need either a custom function or some IIf()
nesting.

=IIf([text1]>[text2], IIf([text1]>[text3],
[text1],[text3]),IIf([text2]>[text3],[text2],[text3]))
 
Back
Top