You need a nested IIf to set value:
SELECT IIf([Job Name]="A","Red", IIf([Job Name]="B","BLUE", IIf([Job Name]="C","Green", "Black"))) AS NameColor, Count(*) AS NameCount
FROM TrendRemedytbl
GROUP BY [Job Name];
Or use Switch function:
SELECT Switch([Job Name]="A","Red", [Job Name]="B","BLUE", [Job Name]="C","Green") AS NameColor, Count(*) AS NameCount
FROM TrendRemedytbl
GROUP BY [Job Name];
I have no idea how the bar chart will apply these values to color the bars.
Found this code from a thread. I tested it in the Format event of a report and Open event of form. Both worked.
Code:
Private Sub Form_Open(Cancel As Integer)
With Me.Graph1
.SeriesCollection(1).Interior.Color = RGB(255, 128, 128) 'peach
.SeriesCollection(2).Interior.Color = RGB(0, 255, 128) 'green
.SeriesCollection(3).Interior.Color = RGB(0, 128, 255) 'blue
.SeriesCollection(4).Interior.Color = RGB(128, 255, 255) 'turquoise
.SeriesCollection(5).Interior.Color = RGB(255, 255, 128) 'yellow
.SeriesCollection(0).Interior.Color = RGB(255, 0, 255) 'magenta
End With
End Sub