Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textbox on report backcolor

Status
Not open for further replies.

jminn0311

Technical User
Jan 7, 2004
66
US
How do I get certain textbox's to change backcolor but other to remain the same. I have a report that needs to change the backcolor of textbox's that contain the word "Warning" to red. The problem is it changes all the textbox's backcolor not just the one specified. Does anyone have any ideas on how to accomplish this?
If InStr(1, Me.Steps, "Caution", vbTextCompare) = 1 Then
'replace it with capts
Me.Steps = Replace(Me.Steps, "Caution", "CAUTION", 1)
Me.Detail.BackColor = 255
End If
If InStr(1, Me.Steps, "Warning") = 1 Then
'replace it with capts
Me.Steps = Replace(Me.Steps, "Warning", "WARNING", 1)
Me.Detail.BackColor = 10

End If

Thank you in advance for any responses

Jeff
 
Jeff
Can you use Conditional Formatting (see Format, Conditional Formatting) for the text box in question?

Tom
 
Thank you,
That was so simple it went straight over my head.

What I did

Expression is Left([Steps],4)="Warn" """""Format"""""

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top