Well let's say my table looks like this, where header is the Report Header, Detail, is the report's detail section, and ColorTeamFore refers to font color for the Text Box in my report named 'Team'
Lets say the name of this table is: NBAteamColors
Code:
team ColorHeader ColorDetail ColorTeamFore
Atlanta Hawks #CC3333 #01244C #CCCCFF
Boston Celtics #000000 #888888 #000000
Charlotte Bobcats #7EC48A #FFF000 #444EEE
So if I were to write the code for the Hawks, it I would have something like one of these:
Code:
me.reportheader.backcolor = #CC3333
dlookup("ColorHeader", "NBAteamColors", "[Atlanta Hawks] = '" & me.reportheader & "'")
OR...if vba is stubborn, you might have to concat double quotes in:
Code:
me.reportheader.backcolor = ""#CC3333"" &
dlookup("ColorHeader", "NBAteamColors", "[Atlanta Hawks] = '" & me.reportheader & "'") & """"
How would I go about writing the code for adding the colors to the other parts of the report (fore color, detail section) and also for adding colors for the other teams?
Do I use the 'If' and 'End If'? Any tutorials for this stuff?