Max function???

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
 
R

Rick Brandt

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]))
 

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