color with report

I

ingbank

Hi
I have a report with a field called Art, there are about 30 records when i print this report
i'd like to print the records where Art is like car in red and the records where Art is like truck in green
Is it possible?
 
I

ingbank

i forgot to tell you that i can't use a conditional formatting function because i have more than 3 Art to change the color
 
D

Duane Hookom

I would create a table tblVehicleColors with two fields [Vehicle] (text to
store Car or Truck,...) and [TheColor] (long integer or store color value).
Join this table to your report's record source and add the [TheColor] field
to the grid. You can then use code in the On Format event of the section
containing your controls (you must bind TheColor to a text box)
Me.Art.ForeColor = Me.TheColor
When you want to change colors or add more vehicles, you do this in the
table rather than in code.

--
Duane Hookom
MS Access MVP


ingbank said:
Hi
I have a report with a field called Art, there are about 30 records when i print this report.
i'd like to print the records where Art is like car in red and the records
where Art is like truck in green.
 
I

ingbank

i've done it but when i open the report there is a error messag
Run-time error 1
Type mismatch
 
D

Duane Hookom

I'm having trouble seeing your:
Code
Table values and field names
when the error appears
what your report record source looks like
 
Top