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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can VBA change color of text on sub data sheet?

Status
Not open for further replies.

PL01

Technical User
Jun 9, 2008
57
US
Can VBA code change the color of specific text on a sub data sheet that displays in a form? Something like conditional formatting can, but using VBA code.
 
form!subformcontrolname!form!controlname!ForeColor=
 
Maybe. Depends on exactly what you mean. If it is a continuous form then vba will change the color of every row. If you mean specific text within other text strings this can be done using rich text tags, but the coding is a little difficult to do this.
 
Not familiar with rich text tags...is this available with Access2003? Anyway, Access can't find the subform error message for Forms![tablet subform].[Price].ForeColor = 255 where [tablet subform] is the name of the subform. Thanks
 
Forms![tablet subform].[Form].[Price].ForeColor = 255
 
Rich Text is only available in 2007 or later. PWise's solution will change the color of every row if it is a continuous Subdatasheet. That may or may not be what you are looking for. Again, what do you mean by specific text: specific row, specific text within a string, specific control in single form view, other?
 
specific row would do it...just some of the records showing in the sub data sheet...similar with conditional formatting
 
As stated, if it is a continuous view vba will change the color of every row; you have to use conditional formatting to change colors of specific row.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top