[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

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

Posted on 2012-03-13
3
Medium Priority
?
641 Views
Last Modified: 2012-03-14
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?
0
Comment
Question by:stuckp1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 37717412
get rid of the quotes
0
 
LVL 12

Accepted Solution

by:
danishani earned 1000 total points
ID: 37717564
Form_Storage_Automation_Main_Form.HBA1.BackColor = &HF8F8F8

You can also use a HexColor Function as well, you can find in below thread:
http://blogs.office.com/b/microsoft-access/archive/2009/10/26/convert-hexadecimal-color-codes-so-you-can-use-them-in-code.aspx


Hope this helps,
Daniel
0
 

Author Closing Comment

by:stuckp1
ID: 37721722
The removal of quotes didn't work for me, but Daniel's example did work.
What also works is to use MSAccess
Form_Storage_Automation_Main_Form.Snapshot_Quantity.BackColor = 11908533

See http://www.endprod.com/colors/

Again, thanks to everyone.
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

656 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question