change data report textbox forecolor

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Fidell
    New Member
    • Aug 2007
    • 3

    #1

    change data report textbox forecolor

    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_C lick
    ' '''''''the STATUS field is bound to Text1. """"" rs is recordset
    If rs.Fields("STAT US") < 40 THEN
    DataReport1.Sec tions(Section1) .Controls("Text 1") =vbRed
    else
    DataReport1.Sec tions(Section1) .Controls("Text 1") =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
Working...