Connecting Tech Pros Worldwide Forums | Help | Site Map

change data report textbox forecolor

Newbie
 
Join Date: Aug 2007
Posts: 2
#1: Oct 4 '08
I am using data report with ms access database. I want to the rptTextbox color to change based on the value of the the recordset field. Eg to appear red if the field is "FAIL" and black if it is "PASS". My code is
cmdShowReport_Click
' '''''''the STATUS field is bound to Text1. """"" rs is recordset
If rs.Fields("STATUS") < 40 THEN
DataReport1.Sections(Section1).Controls("Text1") =vbRed
else
DataReport1.Sections(Section1).Controls("Text1") =vbBlack
End if

It worked for only the first page of the report. For the other pages, the color was red whether or not the STATUS was "FAIL" . (The first RECORD is "fail")

Pls i need help

Reply