talere12
11-28-2006, 06:56 AM
I am creating a report based on a union query. The first query in the union contains a Department field and the number of employees by department. The second query contains the sum of all the departments. I have unified the two queries and have ordered the results. What I am trying to do now is have the "Totals" section (which is included in the Department field) shade with a background color of yellow. I want all other Department names to remain white. I could have just created the report without the Union and manually changed the BackColor in the totals query, but I figured there has to be a way to accomplish this through VBA. I have tried many different variations of VBA code but have been unsuccessful in accomplishing this. Below is an example of the code that I have tried.
Private Sub Report_Current()
If Me.Department = "Totals" Then
Detail.BackColor = 8454143
Else
Detail.BackColor = 1677215
End If
End Sub
Can someone tell me if there is a way to get this to work???:dunno
Private Sub Report_Current()
If Me.Department = "Totals" Then
Detail.BackColor = 8454143
Else
Detail.BackColor = 1677215
End If
End Sub
Can someone tell me if there is a way to get this to work???:dunno