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!

Change Color of BackColor in Label with vb code?

Status
Not open for further replies.

hefly

Technical User
Feb 6, 2008
134
US
I would like to change the back color of a text box on a form if a condition in my query is met.

Qry_Colors

If [qry_colors].[FieldA] = [qry_colors].[FieldA],
then backcolor of TxtBox named Lease_no = #FF0000, otherwise backcolor = #FFFFFF

Thank you!

Hefly
 
look in the help file under conditional formatting.
 
LOL

A sharp eye dhookem. Yes. :)

I meant to write [qry_colors].FieldA = [qry_colors].[FieldB]

I've been trying to write the query I want, but I think the correct way to do it is to apply conditional formatting to a DLookup value in tableA.

If [qry_1].[String] exists at least once in [tbl_1].[String], then the background color changes.

Thanks dhookem

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top