Help with an IIF stament...

Big_Rob

New member
Local time
Yesterday, 19:25
Joined
Jul 28, 2011
Messages
6
I need help writing a statement.
[Text1Qty] [Text2Qty] [Text3Qty]
The three quantities will vary, but i need to display the text box
with the lowest quantity only....
Thanks in advance.....
 
You can copy and paste the following code in the On Current event of your form and this code will cause only the control with the minimum value to be made visible:
Code:
'find minimum amount
If Me.Text1Qty < Me.Text2Qty And Me.Text1Qty < Me.Text3Qty Then
    Me.Text1Qty.Visible = True
    Me.Text2Qty.Visible = False
    Me.Text3Qty.Visible = False
ElseIf Me.Text2Qty < Me.Text1Qty And Me.Text2Qty < Me.Text3Qty Then
    Me.Text2Qty.Visible = True
    Me.Text1Qty.Visible = False
    Me.Text3Qty.Visible = False
Else
    Me.Text3Qty.Visible = True
    Me.Text1Qty.Visible = False
    Me.Text2Qty.Visible = False
End If
 

Users who are viewing this thread

Back
Top Bottom