Consulting

Results 1 to 4 of 4

Thread: Solved: output message in label

  1. #1

    Solved: output message in label

    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

  2. #2
    Moderator VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,323
    Location
    Untested but something like this?
    [VBA]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[/VBA]
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

  3. #3
    Quote Originally Posted by lucas
    Untested but something like this?
    [vba]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[/vba]
    where would this be placed in the label coding or textbox coding

  4. #4
    cheers thanks got it to work

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •