Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background color 1

Status
Not open for further replies.

daniels012

Technical User
Jan 19, 2005
55
US
I am writing code so that when I hit a certain button, the background turns to a very light purple. What color is very light purple? Or is there a chart or info on where I can find each color?

Thank You,
Michael
 
In the VBA help file take a look at the RGB function.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
How are ya daniels012 . . . . .

In form design view call up the properties for [blue]any TextBox[/blue] (or add one just for testing). Then:
[ol][li]Put the cursor on the [blue]BackColor[/blue] property line and click the three elipses
Elipses.BMP
just to the right.[/li]
[li]Select your color in the [blue]color window[/blue]. Click the [purple]Define Custom Colors[/purple] for [purple]fine control[/purple] over your selection.[/li]
[li]Click Add to Custom Colors[/li]
[li]Click [blue]OK[/blue] to close the color window.[/li][/ol]
When you return to the form the [blue]BackColor[/blue] property now holds the [purple]numeric value for that color.[/purple] A dark shade of purple turnes out to be 10158235. So in you code it would be something like:
Code:
[blue]   Me!BackColor = 10158235[/blue]
As an good assist, maintain a library of your favorites!

Calvin.gif
See Ya! . . . . . .
 
Thank You for your responses. I found the color I desired.

OK
I tried to enter this into a macro, with no success.

So, now I want to enter it in code.
I am not great with coding, but I am trying to learn.
I have a check button on my form. When I click it, and it is true, I would like the background in FormHeader, Details, and Form header to turn to a light purple.

How can I write this??

Thank You,
Michael
 
daniels012 . . . . .

In the [blue]AfterUpdate Event[/blue] for the checkbox, put the cursor on the event line. Then click the three elipses
Elipses.BMP
just to the right. Between the [blue]Private[/blue] line and [blue]End Sub[/blue] line, copy/paste the following:
Code:
[blue]   Me.FormHeader.BackColor = [purple][b]YourColorNumber[/b][/purple]
   Me.Detail.BackColor = [purple][b]YourColorNumber[/b][/purple][/blue]

Calvin.gif
See Ya! . . . . . .
 
Hit submit too soon . . . .

In the following code, [blue]you substitute proper items in [purple]purple[/purple]:
Code:
[blue]   If Me![purple][b]CheckBoxName[/b][/purple] Then
      Me.FormHeader.BackColor = [purple][b]PurpleColorNumber[/b][/purple]
      Me.Detail.BackColor = [purple][b]PurpleColorNumber[/b][/purple]
   Else
      Me.FormHeader.BackColor = [purple][b]NormalColorNumber[/b][/purple]
      Me.Detail.BackColor = [purple][b]NormalColorNumber[/b][/purple]
   End If[/blue]

Calvin.gif
See Ya! . . . . . .
 
Thank You so very much.

You have helped me 2 or 3 times now. I wish I new more about coding. Is there a good book to get at a book store or something??

Thank You,
Michael



ps. I never did get the NotInList to work on one of my forms. I'll write in a different topic about that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top