Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15

    Colors in TextBoxes and Controls do not work in Access 2010 as in previous versions.

    Of the following code, the statements for color do not work, in Access 2010; the fontsize statement works:
    Me.MsgBoard.SetFocus
    Me.MsgBoard.BackColor = vbYellow
    Me.MsgBoard.ForeColor = vbRed
    Me.MsgBoard.FontSize = 12
    What is needed to make the Back Color and fore color statements work???

    Notes:
    MsgBoard is a multi-line text box on a form. The code is in the form's module.
    Me refers to a fairly complex form that was originally generated in Access 2007, where color was easy and straightforward to control.
    I also have found the ability to control color on control buttons and toggle buttons not to work;whereas they worked fine in Access 2007.

    Any help in understanding the color control changes from Access 2007 to Access 2010, would be very much appreciated!!

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    I don't know anything about 2007 color properties but I recently battled this out with 2003 to 2010 conversion.

    I simply translated everything into VBA. It seems VBA will offer its translation of the Pantone color chart using numbers as representations. After using the color palette in the control's property setting (This offers a word as a description) I then use the VBA editors immediate window to translate this (description) into Pantone. This number that VBA understands seems to translate well across the different versions of Access.

    I created a key in a spreadsheet using the old version, calling the control's property in the Immediate Window and logging the result. Then I used the number (translation) offered by VBA in the new version of Access. Pasting the number directly into the property window of a control or directly in VBA.

  3. #3
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15
    Could you supply some specifics? Code or screen shots of property settings and a screen shot of the resuts. I appreciate your response but cannot see how to use it.

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Yes, I will have a chance later to post a description. Unfortunately, It is not a simple issue. At least, my approach is tedious.

  5. #5
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    This process does not work for the newer accent themes that are lighter by percentages. It will translate the color but won't allow for the "Theme"

    You can go straight into the palette and select a color or type in the RGB or HSL values if you know them.
    .
    .
    .
    Click image for larger version. 

Name:	Palette.jpg 
Views:	19 
Size:	74.9 KB 
ID:	14156


    .
    Click image for larger version. 

Name:	RGB.jpg 
Views:	19 
Size:	44.1 KB 
ID:	14157

    Whatever you select will result in a number in the properties.


    .
    Click image for larger version. 

Name:	ColorProp.jpg 
Views:	19 
Size:	23.8 KB 
ID:	14158


    .
    This, along with themes can be translated into another number in VBA. It can then be used within VBA to adjust the properties of controls, etc or even pasted directly into the properties window. I used the following in a click event to produce a result in the Imediate Window. Ctrl+G will display the Immediate WIndow. I suppose you can send the info anywhere you like.

    .
    Code:
    Dim strColor As String
    strColor = Me.cmdOne.BackColor
    strColor = "cmdOne.BackColor = " & strColor
    Debug.Print strColor
    
    Dim strBorder As String
    strBorder = Me.cmdOne.BorderColor
    strBorder = "cmdOne.BorderColor = " & strBorder
    Debug.Print strBorder
    .
    THis will produce the following.... totally different numbering convention.

    .
    Click image for larger version. 

Name:	Immediate.jpg 
Views:	19 
Size:	12.9 KB 
ID:	14159


    With this you can catalog what the values are for your controls and use it across the versions of Access.

  6. #6
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15
    Thank you, this was an effort, its appreciated!
    However, even if the colors are reported back correctly, as set for testbox boarder and background; they remain either black or white in form view.
    For toggle buttons I've gotten background colors to actually be technicolor. But not foreground colors.
    Something was broken between 2007 and 2010; thats what I'm trying to trace! and fix?

  7. #7
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    When Back Colors are reported to not be working, the usual culprit is that the Back Style Property, for the Control, is set to Transparent instead of Normal.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  8. #8
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by HankB View Post
    Something was broken between 2007 and 2010; thats what I'm trying to trace! and fix?
    I guess I should of just went straight to testing vbRed in 2010. I did now and it works fine for back and border colors.

    Like Missinglinq mentioned, something else must be wrong.

    It has been so long since I have used vbRed and vbBlack I totally forgot about their existence. For anyone else searching and reading, I started using these translation techniques a long time ago when trying to get colors to match across different formats, ie Web pages, Adobe PDF, etc. Sometimes all you have is a company logo to start with and it is nice to be able to carry a theme into your app(s)

  9. #9
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15
    I've debug.printed all the control BackStyles and BorderStyles; they are Normal and Solid Respectively.
    So, what's different between 2007 and 2010 to make technicolor forms monochromatic?

  10. #10
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15
    I've opened it in 2007.
    Its vividly technicolor in 2007.
    It's blandly monochromatic in 2010!

  11. #11
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Something must be corrupt within the form's class module.

    Try starting out again in a new blank accdb file. In a new form create some new controls. start a NEW click event and THEN transfer over some of your VBA.

    See if the behavior persists. Like I mentioned. I had no problem getting a VBRed Border on a control button with a black background using VBA in a click event.

  12. #12
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15
    I started in a new and blank accdb created a form with a text box; set the textbox's back and border colors.
    Its monochrome in 2010 but colorful in 2007.

  13. #13
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    Post your code here. I would like to try that out myself.

  14. #14
    HankB is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2013
    Location
    Milwaukee
    Posts
    15
    There is no code.
    I just created a form with a text box on it and set the back and border colors in form design mode in Access2010 with no use of VBA. There are no modules or class Modules in this test accdb.
    Its monochrome in 2010 but colorful in 2007.

  15. #15
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows XP Access 2003
    Join Date
    Aug 2013
    Posts
    7,862
    That would indicate a serious problem. I have never experienced such a problem. Earlier, I was able to adjust color properties to a textbox just as you described.

    If I choose a color from the color palette it updates the properties for me. The color palette is available under "More Colors". I am not aware of any global settings that would override this. Default control settings are only valid until they are overridden by the properties window.

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 10-23-2013, 07:56 AM
  2. Problem Creating Excel Chart TextBoxes in Access 2010
    By JonMulder in forum Programming
    Replies: 5
    Last Post: 03-24-2013, 08:16 PM
  3. Runtime 2010 with previous versions installed
    By libraccess in forum Access
    Replies: 2
    Last Post: 12-30-2012, 09:19 PM
  4. Controls for OLE Image Access 2010
    By Mnelson in forum Access
    Replies: 1
    Last Post: 07-10-2012, 06:19 PM
  5. Cant get Yes/No to work in Query Access 2010
    By colisemo in forum Queries
    Replies: 1
    Last Post: 09-20-2011, 02:21 PM

Tags for this Thread

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