Change forecolor of field in subform Access 2007

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • TD

    Change forecolor of field in subform Access 2007

    I am trying to change the forecolor of a field in a subform that is in
    datasheet view. I am using Access 2007. I have tried everything I
    can think of to do this but the text still appears in black. I need
    it to appear in red if the field has the word "YES" in it. Is there
    something in Access 2007 that keeps this from working?????

  • Rich P

    #2
    Re: Change forecolor of field in subform Access 2007

    Access does not have the capability to change colors of fonts/cells in a
    datasheet view -- natively.

    One fix that comes to mind would be to create a com User control in
    VB2005 using a datagridview control (the .Net equivalent of an Access
    subform) which has mega versitility and then implement that in Access.
    The only caveat here would be that whoever used the control would need
    to be running the .Net 2.0 framework on the respective workstation(s)

    Rich

    *** Sent via Developersdex http://www.developersdex.com ***

    Comment

    • TD

      #3
      Re: Change forecolor of field in subform Access 2007

      On Feb 20, 2:56 pm, Rich P <rpng...@aol.co mwrote:
      Access does not have the capability to change colors of fonts/cells in a
      datasheet view -- natively.  
      >
      One fix that comes to mind would be to create a com User control in
      VB2005 using a datagridview control (the .Net equivalent of an Access
      subform) which has mega versitility and then implement that in Access.
      The only caveat here would be that whoever used the control would need
      to be running the .Net 2.0 framework on the respective workstation(s)
      >
      Rich
      >
      *** Sent via Developersdexht tp://www.developersd ex.com***
      Thanks for the help!

      Comment

      • bobh

        #4
        Re: Change forecolor of field in subform Access 2007

        On Feb 20, 12:37 pm, TD <d...@adsi-sc.comwrote:
        I am trying to change the forecolor of a field in a subform that is in
        datasheet view.  I am using Access 2007.  I have tried everything I
        can think of to do this but the text still appears in black.  I need
        it to appear in red if the field has the word "YES" in it.  Is there
        something in Access 2007 that keeps this from working?????
        Well, you can try this way on your form
        you need to create two unbound textboxes

        in the controlsource of the first one
        =IIf([yourYesNofield]="yes",[yourYesNofield],"")
        define the forecolor of this one as red(or whatever color you want)

        in the controlsource of the second one
        =IIf([yourYesNofield]="no",[yourYesNofield],"")
        define the forecolor of this one as black(or whatever color you want)

        be sure you have the real [yourYesNofield] field in place but set its
        visible property to false.

        make sure all three boxes are the same size and layer them on top of
        each other

        change the form property from datasheet to continuous form

        hope this helps
        bobh.

        Comment

        • Stephen Lebans

          #5
          Re: Change forecolor of field in subform Access 2007

          Simply use Conditional Formatting. Look it up in Access Help.

          --

          HTH
          Stephen Lebans

          Access Code, Tips and Tricks
          Please respond only to the newsgroups so everyone can benefit.


          "TD" <dlee@adsi-sc.comwrote in message
          news:d318105f-6edd-4024-8175-be9f849b9566@i7 g2000prf.google groups.com...
          >I am trying to change the forecolor of a field in a subform that is in
          datasheet view. I am using Access 2007. I have tried everything I
          can think of to do this but the text still appears in black. I need
          it to appear in red if the field has the word "YES" in it. Is there
          something in Access 2007 that keeps this from working?????
          >

          Comment

          Working...