Got it border to red and bold, but now need to restrict to certain ones.

I got borders to be red and bold, but did not realized, it is doing this for every due date.  I only need it on those due days that will be wihtin days 7 or less.  So, back to myoriginal issue of conditionally adding red/bold borders to these boxes.
Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
'If Due date is with 7 or less days, make the box and data red

    If [TaskDueDate] < Date + 7 And (IsNull([TaskCompletionDate]) Or [TaskCompletionDate] = "") Then
         Me.lblTaskDueDate.BorderStyle = 1
         Me.lblTaskDueDate.BorderColor = RGB(239, 5, 29)
         Me.lblTaskDueDate.BorderWidth = 2
         Me.TaskDueDate.BorderStyle = 1
         Me.TaskDueDate.BorderColor = RGB(239, 5, 29)
         Me.TaskDueDate.BorderWidth = 2
    End If


End Sub

Open in new window

Sandra SmithRetiredAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mbizupCommented:
I don't think it is possible to do things exactly as you want.  The closest approximation I can think of is to mimic a border with a slightly larger textbox in the background, and conditionally format that.
0
mbizupCommented:
Wow!  I completely missed this one earlier.

The report needs to be opened in Print Preview or printed (Normal View).   Report View  won't work.

Apart from that, all you need to do is include an Else block for contrasting conditions, and your formatting will show up as expected:

Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
'If Due date is with 7 or less days, make the box and data red

    If [TaskDueDate] < Date + 7 And (IsNull([TaskCompletionDate]) Or [TaskCompletionDate] = "") Then
         Me.lblTaskDueDate.BorderStyle = 1
         Me.lblTaskDueDate.BorderColor = RGB(239, 5, 29)
         Me.lblTaskDueDate.BorderWidth = 2
         Me.TaskDueDate.BorderStyle = 1
         Me.TaskDueDate.BorderColor = RGB(239, 5, 29)
         Me.TaskDueDate.BorderWidth = 2
    Else
         Me.lblTaskDueDate.BorderStyle = 0
         Me.lblTaskDueDate.BorderColor = 0
         Me.lblTaskDueDate.BorderWidth = 0
         Me.TaskDueDate.BorderStyle = 0
         Me.TaskDueDate.BorderColor = 0
         Me.TaskDueDate.BorderWidth = 0

End Sub 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Sandra SmithRetiredAuthor Commented:
EXCELLENT! Thank you

Sandra
0
mbizupCommented:
Glad to help out :)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Applications

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.