Access 2010 VBA: Looked all over but can't find straight answer for how to set color property of field using, #NNNNNN format

답변됨 Access 2010 VBA: Looked all over but can't find straight answer for how to set color property of field using, #NNNNNN format

  • Dienstag, 13. März 2012 21:15
     
     

    Background:

    I have this VBA statement

    Form_Storage_Automation_Main_Form.HBA1.BackColor = "#F8F8F8"

    I'm getting a "Type Mismatch" error.

    I've looked through many online blogs and forums without success. The approach above I got out of a VB example. Is there a difference in VBA?

    I don't understand what even the type would be?

    What would be the correct way to do this?

Alle Antworten

  • Dienstag, 13. März 2012 21:21
     
     Beantwortet Enthält Code
    Form_Storage_Automation_Main_Form.HBA1.BackColor = &HF8F8F8


    Andrey V Artemyev | Saint-Petersburg, Russia
    Russian blog artemyev.biztoolbox.ru

    • Als Antwort markiert stuckip Dienstag, 13. März 2012 21:23
    •  
  • Dienstag, 13. März 2012 21:24
     
     

    Thanks!

  • Dienstag, 13. März 2012 21:51
     
     
    Nice technique. You might also want to look at the more traditional technique of using the "RGB()" function; although I actually like Andrey's technique better.

    Matthew Slyman M.A. (Camb.)

  • Mittwoch, 14. März 2012 18:41
     
     

    Thanks!