PDA

View Full Version : Solved: output message in label



darkrider
02-26-2007, 07:09 PM
Hi there everybody,

i have a small probelm with vba, which is.

i have a textbox for property value
a textbox for average price
a textbox for gettting the value from property and subtracting from average price then outputs the difference in the 3rd text box.

i would like the program to output two messages in a label, like this value is high or this value is low.

for example,
textbox 1 value is 250
textbox 2 value is 200
textbox 3 value is 50

so the label should output a message saying this is over the average price, or if it was lower then it should output is is lower than average price.

how would i do this

lucas
02-26-2007, 08:53 PM
Untested but something like this?
If TextBox1.Value >= TextBox2.Value Then
Label1.Caption = "The value in box 1 is higher than box 2"
Else
Label1.Caption = "The value in box 1 is lower than box 2"
End If

darkrider
02-27-2007, 01:39 AM
Untested but something like this?
If TextBox1.Value >= TextBox2.Value Then
Label1.Caption = "The value in box 1 is higher than box 2"
Else
Label1.Caption = "The value in box 1 is lower than box 2"
End If

where would this be placed in the label coding or textbox coding

darkrider
02-27-2007, 01:47 AM
cheers thanks got it to work