Display Image Depending on Text Box Values

  • Hi,


    I have two Text Boxes (TextBox1 & TextBox2) on a User Form.


    TextBox1 shows the number of required items needed to be assembled that hour and the operator enters the number of items actually assembled in that hour in TextBox2.
    I have 3 images (Traffic lights, Red, Amber, Green) next to the the above mentioned TextBoxes, Image 1, Image 2 & image 3.


    During UserForm_Initialize I have hidden all the images by Image1.Visible = False etc.


    Depending of the values entered in Textbox2 I want a specific image to be visible, for example –

    If Textbox2 is the same as Textbox1 image1 will be visible and image 2&3 not to be visible
    If Textbox2 is within 1 unit under Textbox1 image2 will be visible and image 1&3 not to be visible
    If Textbox2 is 2 or more units under Textbox1 image3 will be visible


    Any ideas?


    Thanks in advance.

  • Hi


    Is the traffic light and actual "Traffic Light" image (3 off) with the relevant light lit up (RYG), or just an object that could be changed in colour (RYG) rather than having 3 different images to play with?

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!