I need to change colors as scores change. The conditional format only works on textbox. I would like to change the label as well. -- thanks, foxydev77
I need to change colors as scores change. The conditional format only works on textbox. I would like to change the label as well. -- thanks, foxydev77
Use code in the Detail Format event to change both controls at the same time: If [SomeField] = 1 [SomeField].BackColor = vbBlue [SomeLabel].BackColor = vbBlue Elseif [Somefield] = 2 Then [SomrLabel].BackColor = vbRed [SomeField].BackColor = vbRed ElseIf [SomeField] = 3 Then etc..... Else [SomeLabel].BackColor = vbWhite [SomeField].BackColor = vbWhite End If -- Fred Please respond only to this newsgroup. I do not reply to personal e-mail
You could write some code in the On Format event of the report section containing the controls. Select Case Me.txtScore Case 0 Me.lblScore.BackGround = vbRed Case .... .... End Select -- Duane Hookom Microsoft Access MVP
Actually the property is BackColor and some sample code would be similar to: Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer) Select Case Me.txtScore Case Is < 25 Me.Label6.BackColor = vbYellow Case Is < 50 Me.Label6.BackColor = vbGreen Case Else Me.Label6.BackColor = vbWhite End Select End Sub -- Duane Hookom Microsoft Access MVP
1.Programmatically detach object in unbound object frame to a bound object frame
hello, On one of my form, I have a hidden unbound object frame with a Word document template in it. I want users to press a button and then it will detach the Word template from the unbound object frame and insert it into a bound object frame. Thanks in advance. Thomas
2.Loop through objects changing background color of certain kinds of objects
I think that sums it up. If someone can help me, TIA. Just to clarify- I have several forms- and I want to run a program that will look at each one, and on each form, if the type of object is a Header, Form, Footer, or Label, change it's background to a given color. Something like For each object in objects...? The syntax excapes me at the moment. -BrianDP
3.Word 2007: programmatically determine current color scheme
4.Change the backgroud color according to condition
Hi all, I woulid like to enhance my form by changing the backgroud color of my text box when the firstname change. I would like to have something like that: Name : MARTIN First name Alan xxxxxxx 00000000 (blue) Alan rrrrrrrrrrr 11111111 (blue) Alan zzzzzz 22222222 (blue) Peter aaaaaaa 11111111 (red) Peter xxxxxxx 00000000 (red) Zita eeeeeee 22222222 (blue) Is it possible and who has any idea ?
5.Background color based on condition
I have a continuous form and want to change the backcolor of a field in one column based on a condition in another column. My problem is that when the field is clicked the backcolor that is appropiate is applied to the whole column not just that one record. Here is my code Private Sub Form_Current() Dim lngYellow As Long, lngWhite As Long lngYellow = RGB(255, 255, 0) lngWhite = RGB(255, 255, 255) If Me.ChATimeIn = 0 Or IsNull(ChATimeIn) Then Me!ATimeIn.BackColor = lngWhite Else Me!ATimeIn.BackColor = lngYellow End If Thanks Eric
6. Change textbox color based on a condition
Users browsing this forum: No registered users and 87 guest