Link to home
Start Free TrialLog in
Avatar of Lou Dufresne
Lou DufresneFlag for United States of America

asked on

MS access 2007 Setting Backcolor ona label Field

I have a form that allows the user to click on a label field and some code runs.
I want to change the backcolor of the label field when the user clcks on it.
I am trying to use the folllowing code but continually get an error message:
   
DoCmd.SetProperty,"Application Date Label",acPropertyBackColor, "#22B14C"

The syntax is not correct because I continue to get a message " Argument not Optional"

Question:
What is the correct Syntax?
Can this command be used on a label?

Thanks
Ldufresne

Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image


me.labelName.backcolor="#22B14C"
SOLUTION
Avatar of GRayL
GRayL
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lou Dufresne

ASKER

Thanks everyone I used information from both of your suggestions to do what I wanted.

Ldufresne
You accepted

me.labelName.backcolor="#22B14C"

as the answer, but by my tests in Access 2003 demonstrated that the back color property will not accept a string value - only a numerical or VB variable value.  Can you explain how you 'used the information to do what you wanted.' for the benefit of any future readers of this string?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Ldufresne,
Click on the Request Attention to get the mod notified
If http:#a32194102 had been originally accepted in lieu of http:#a32187407, we would not be having this conversation now.  Thanks for setting it right.
Thanks all. I appreciate everyones help always. You always provide me the framwork to create the solution that fits my issue. This is the best service for correct ansuers on the web. I have been a member for many years and prefer this service because the experts know the solutions to the questions.
       I always profide enough points so that I can be as fair as possible with all experts who took the time to provide their input to my issue.
      I thank you for your quick, direct and accurate answers to my questions which sometimes can be a little misleading.
Thanks again for the solutions you provide .
Ldufresne