Textbox update & Check box = Update link

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Gari
    New Member
    • Jan 2007
    • 41

    Textbox update & Check box = Update link

    Hello everyone,

    I have two forms: FORM1 and FORM2.

    On FORM1 there is a check box (CHECK). When CHECK is checked, the data is updated in a YES/NO data type table (TABLE) field.

    On FORM2 I have a text box (TEXTBOX).

    When the YES/NO data field in TABLE is set to YES (that is to say when CHECK in FORM1 was checked, ie when CHECK = TRUE), I want TEXTBOX to return the text “YES”. Otherwise, I want TEXTBOX to return the text “NO”.

    Moreover, I would like “YES” to be in a green colour and “NO” to be in a red colour.

    What would be the code to do that?

    Please note that FORM1 and FORM2 return several filtered data (I don’t know if this makes a difference in the code…).

    I hope I was clear enough.

    Thank you for your help.

    Best regards,

    G.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    Is the textbox on form2 bound? If it is bound to a Yes/No field, perhaps you can get away with just setting the format on the field. As for the red/green, I think Acces can do conditional formatting, something like Excel.

    Comment

    • NeoPa
      Recognized Expert Moderator MVP
      • Oct 2006
      • 32668

      #3
      I don't think you have conditional formatting available but setting colours in code - at the same time the value is set can certainly be done.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by NeoPa
        I don't think you have conditional formatting available but setting colours in code - at the same time the value is set can certainly be done.
        D'oh! I had to do the very same thing myself, back around November. What a memory... :o

        Comment

        • Gari
          New Member
          • Jan 2007
          • 41

          #5
          I didn't linked the box actually. So I have done it and it works perfectly !
          For the colour, it does exist a conditionnal formating in Access.

          Thank you very much for your help ! Appreciated.

          Comment

          • Killer42
            Recognized Expert Expert
            • Oct 2006
            • 8429

            #6
            Originally posted by Gari
            I didn't linked the box actually. So I have done it and it works perfectly !
            For the colour, it does exist a conditionnal formating in Access.
            Hooray! I win. :D

            Seriously, glad we were able to help.

            Comment

            • NeoPa
              Recognized Expert Moderator MVP
              • Oct 2006
              • 32668

              #7
              Originally posted by Gari
              As for the colour, Conditional Formatting does exist in Access.
              I'll make a note of that thanks.

              Comment

              Working...