R Ray Apr 14, 2004 #1 i need to subtract text box 1 from text box 2 and if text box 1 is larger than text box 2 it should equal zero
i need to subtract text box 1 from text box 2 and if text box 1 is larger than text box 2 it should equal zero
G Guest Apr 14, 2004 #2 Try this in the change event for textbox If textbox1>textbox2 the textbox1= elseif textbox1<=textbox2 the textbox1=textbox2-textbox end i hope it help Rocco
Try this in the change event for textbox If textbox1>textbox2 the textbox1= elseif textbox1<=textbox2 the textbox1=textbox2-textbox end i hope it help Rocco
E Eric Dreksler Apr 14, 2004 #3 This is for code w/ in a textbox (or other control): =iif(TextBox1 > TextBox2, 0, TextBox2 - TextBox1) (This should go in the .ControlSource field) Or just a standard If..ElseIf..EndIf If TextBox1 > TextBox2 intResult = 0 Else intResult = TextBox2 - TextBox1 End If Eric Dreksler
This is for code w/ in a textbox (or other control): =iif(TextBox1 > TextBox2, 0, TextBox2 - TextBox1) (This should go in the .ControlSource field) Or just a standard If..ElseIf..EndIf If TextBox1 > TextBox2 intResult = 0 Else intResult = TextBox2 - TextBox1 End If Eric Dreksler
R Rick Apr 14, 2004 #4 =iif([Text1]>[Text2],0,[Text2]-[Text1]) I'm assuming your text boxes are formatted as numbers. Rick i need to subtract text box 1 from text box 2 and if text box 1 is larger than text box 2 it should equal zero
=iif([Text1]>[Text2],0,[Text2]-[Text1]) I'm assuming your text boxes are formatted as numbers. Rick i need to subtract text box 1 from text box 2 and if text box 1 is larger than text box 2 it should equal zero