Results 1 to 4 of 4
  1. #1
    thexxvi is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    63

    Change Color Within a String

    Hello,

    I don't know if this is possible and I've looked all over to find the answer, so many someone here can help.



    I have a string that is going to be displayed in a textbox containing two different DLookups. I want to format the value of the first Dlookup as one color and I want to format the value of the second Dlookup as a different color, all within the same string and in the same text box. Is this possible and if so, how could I display that?

    Thank you in advance for your help!

  2. #2
    Perceptus's Avatar
    Perceptus is offline Expert
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    Knoxville, Tennessee
    Posts
    659
    if you store the value of the color to an object (variant). then it should freely cast to a color. If you store a string, you would need to convert.

    Me.backcolor = longvalue of color wanted?

  3. #3
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    Do you mean you want something like this to display in your textbox?

    This dlookup is different from this dlookup

    If not and Perceptus's suggestion is not what you require please provide an example

    If it is, look at setting your textbox to rich text, then enter something like

    ="This <font color=#ED2C32>" & "dlookup" & "</font> is different from this <font color=#0041C2>" & "dlookup" & "</font>"

    Replace dlookup with your dlookup functions

    you'll need to look on the web to find the colours you require

  4. #4
    thexxvi is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    May 2015
    Posts
    63
    Thank you both for the response. Ajax, that worked perfectly! Thanks again!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. change tab color or header color
    By witz07 in forum Access
    Replies: 6
    Last Post: 03-31-2016, 05:31 PM
  2. Replies: 8
    Last Post: 05-21-2014, 07:21 PM
  3. Replies: 3
    Last Post: 01-01-2014, 11:21 PM
  4. Change Change FormHeader Color
    By burrina in forum Forms
    Replies: 4
    Last Post: 12-19-2012, 08:18 PM
  5. change cell color
    By bishop743 in forum Programming
    Replies: 0
    Last Post: 02-01-2009, 11:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums