If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Conditional formatting of a subform's background color
I've read about 50 examples of how to use Conditional Formatting to change
the color of specific fields in a continuous form. Is there a way to use it to change the form's background color for that particular record, while leaving the records that are have not met the condition in their normal format? What I'm attempting to do is build a form that shows all of the users who are out on break, with their "Out" time and their "Due In" time. I want to display the users who have not passed their "Due In" with a green background, and the ones who have passed that time with a red background. I can get one or the other, but it all depends on the first record in the form. If the first record in the form meets the "lapsed" criteria, the entire subform displays with the red background, and vice versa. Can this be done with a continuous form, or do I need to look into another way to attempt this? Here is my code... part of my problem is I'm not real sure where to put this code so that it runs on every record, or if I've even got it written correctly: If DateDiff("m", Me!DueTime, Now()) 15 Then PastClockTime = 1 Else PastClockTime = 2 End If Select Case PastClockTime Case 1 Me.Detail.BackColor = 1643706 Me.Label1.ForeColor = 16777215 Me.Label3.ForeColor = 16777215 Me.Label5.ForeColor = 16777215 Me.Label7.ForeColor = 16777215 Case 2 Me.Detail.BackColor = 16777215 Me.Label1.ForeColor = 0 Me.Label3.ForeColor = 0 Me.Label5.ForeColor = 0 Me.Label7.ForeColor = 0 End Select Any help is much appreciated. Thanks! |
#2
|
|||
|
|||
Conditional formatting of a subform's background color
Nicholas,
If you can make your subform controls transparent, you can use an unbound text control behind your fields, and apply ConditionalFormatting to that. Make the "background" text contol as high and as wide as your subform detail record. Cond/Formatting that background control will make the backgrounds of all your transparent fields "appear" to correctly colored. Condition1 Expression Is [PastClockTime] = 1 Condition2 Expression Is [PastClockTime] = 2 hth -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Nicholas Scarpinato" wrote in message ... I've read about 50 examples of how to use Conditional Formatting to change the color of specific fields in a continuous form. Is there a way to use it to change the form's background color for that particular record, while leaving the records that are have not met the condition in their normal format? What I'm attempting to do is build a form that shows all of the users who are out on break, with their "Out" time and their "Due In" time. I want to display the users who have not passed their "Due In" with a green background, and the ones who have passed that time with a red background. I can get one or the other, but it all depends on the first record in the form. If the first record in the form meets the "lapsed" criteria, the entire subform displays with the red background, and vice versa. Can this be done with a continuous form, or do I need to look into another way to attempt this? Here is my code... part of my problem is I'm not real sure where to put this code so that it runs on every record, or if I've even got it written correctly: If DateDiff("m", Me!DueTime, Now()) 15 Then PastClockTime = 1 Else PastClockTime = 2 End If Select Case PastClockTime Case 1 Me.Detail.BackColor = 1643706 Me.Label1.ForeColor = 16777215 Me.Label3.ForeColor = 16777215 Me.Label5.ForeColor = 16777215 Me.Label7.ForeColor = 16777215 Case 2 Me.Detail.BackColor = 16777215 Me.Label1.ForeColor = 0 Me.Label3.ForeColor = 0 Me.Label5.ForeColor = 0 Me.Label7.ForeColor = 0 End Select Any help is much appreciated. Thanks! |
#3
|
|||
|
|||
Conditional formatting of a subform's background color
That's an interesting way to do it... I'll try that. Thanks!
"Al Campagna" wrote: Nicholas, If you can make your subform controls transparent, you can use an unbound text control behind your fields, and apply ConditionalFormatting to that. Make the "background" text contol as high and as wide as your subform detail record. Cond/Formatting that background control will make the backgrounds of all your transparent fields "appear" to correctly colored. Condition1 Expression Is [PastClockTime] = 1 Condition2 Expression Is [PastClockTime] = 2 hth -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Nicholas Scarpinato" wrote in message ... I've read about 50 examples of how to use Conditional Formatting to change the color of specific fields in a continuous form. Is there a way to use it to change the form's background color for that particular record, while leaving the records that are have not met the condition in their normal format? What I'm attempting to do is build a form that shows all of the users who are out on break, with their "Out" time and their "Due In" time. I want to display the users who have not passed their "Due In" with a green background, and the ones who have passed that time with a red background. I can get one or the other, but it all depends on the first record in the form. If the first record in the form meets the "lapsed" criteria, the entire subform displays with the red background, and vice versa. Can this be done with a continuous form, or do I need to look into another way to attempt this? Here is my code... part of my problem is I'm not real sure where to put this code so that it runs on every record, or if I've even got it written correctly: If DateDiff("m", Me!DueTime, Now()) 15 Then PastClockTime = 1 Else PastClockTime = 2 End If Select Case PastClockTime Case 1 Me.Detail.BackColor = 1643706 Me.Label1.ForeColor = 16777215 Me.Label3.ForeColor = 16777215 Me.Label5.ForeColor = 16777215 Me.Label7.ForeColor = 16777215 Case 2 Me.Detail.BackColor = 16777215 Me.Label1.ForeColor = 0 Me.Label3.ForeColor = 0 Me.Label5.ForeColor = 0 Me.Label7.ForeColor = 0 End Select Any help is much appreciated. Thanks! |
#4
|
|||
|
|||
Conditional formatting of a subform's background color
Let me know how you make out...
"Nicholas Scarpinato" wrote in message ... That's an interesting way to do it... I'll try that. Thanks! "Al Campagna" wrote: Nicholas, If you can make your subform controls transparent, you can use an unbound text control behind your fields, and apply ConditionalFormatting to that. Make the "background" text contol as high and as wide as your subform detail record. Cond/Formatting that background control will make the backgrounds of all your transparent fields "appear" to correctly colored. Condition1 Expression Is [PastClockTime] = 1 Condition2 Expression Is [PastClockTime] = 2 hth -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Nicholas Scarpinato" wrote in message ... I've read about 50 examples of how to use Conditional Formatting to change the color of specific fields in a continuous form. Is there a way to use it to change the form's background color for that particular record, while leaving the records that are have not met the condition in their normal format? What I'm attempting to do is build a form that shows all of the users who are out on break, with their "Out" time and their "Due In" time. I want to display the users who have not passed their "Due In" with a green background, and the ones who have passed that time with a red background. I can get one or the other, but it all depends on the first record in the form. If the first record in the form meets the "lapsed" criteria, the entire subform displays with the red background, and vice versa. Can this be done with a continuous form, or do I need to look into another way to attempt this? Here is my code... part of my problem is I'm not real sure where to put this code so that it runs on every record, or if I've even got it written correctly: If DateDiff("m", Me!DueTime, Now()) 15 Then PastClockTime = 1 Else PastClockTime = 2 End If Select Case PastClockTime Case 1 Me.Detail.BackColor = 1643706 Me.Label1.ForeColor = 16777215 Me.Label3.ForeColor = 16777215 Me.Label5.ForeColor = 16777215 Me.Label7.ForeColor = 16777215 Case 2 Me.Detail.BackColor = 16777215 Me.Label1.ForeColor = 0 Me.Label3.ForeColor = 0 Me.Label5.ForeColor = 0 Me.Label7.ForeColor = 0 End Select Any help is much appreciated. Thanks! |
#5
|
|||
|
|||
Conditional formatting of a subform's background color
It's not fancy, but should do the trick...
Let me know how you make out. -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Nicholas Scarpinato" wrote in message ... That's an interesting way to do it... I'll try that. Thanks! "Al Campagna" wrote: Nicholas, If you can make your subform controls transparent, you can use an unbound text control behind your fields, and apply ConditionalFormatting to that. Make the "background" text contol as high and as wide as your subform detail record. Cond/Formatting that background control will make the backgrounds of all your transparent fields "appear" to correctly colored. Condition1 Expression Is [PastClockTime] = 1 Condition2 Expression Is [PastClockTime] = 2 hth -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." "Nicholas Scarpinato" wrote in message ... I've read about 50 examples of how to use Conditional Formatting to change the color of specific fields in a continuous form. Is there a way to use it to change the form's background color for that particular record, while leaving the records that are have not met the condition in their normal format? What I'm attempting to do is build a form that shows all of the users who are out on break, with their "Out" time and their "Due In" time. I want to display the users who have not passed their "Due In" with a green background, and the ones who have passed that time with a red background. I can get one or the other, but it all depends on the first record in the form. If the first record in the form meets the "lapsed" criteria, the entire subform displays with the red background, and vice versa. Can this be done with a continuous form, or do I need to look into another way to attempt this? Here is my code... part of my problem is I'm not real sure where to put this code so that it runs on every record, or if I've even got it written correctly: If DateDiff("m", Me!DueTime, Now()) 15 Then PastClockTime = 1 Else PastClockTime = 2 End If Select Case PastClockTime Case 1 Me.Detail.BackColor = 1643706 Me.Label1.ForeColor = 16777215 Me.Label3.ForeColor = 16777215 Me.Label5.ForeColor = 16777215 Me.Label7.ForeColor = 16777215 Case 2 Me.Detail.BackColor = 16777215 Me.Label1.ForeColor = 0 Me.Label3.ForeColor = 0 Me.Label5.ForeColor = 0 Me.Label7.ForeColor = 0 End Select Any help is much appreciated. Thanks! |
Thread Tools | |
Display Modes | |
|
|