INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Can VBA change color of text on sub data sheet?

Can VBA change color of text on sub data sheet?

(OP)
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.

RE: Can VBA change color of text on sub data sheet?

form!subformcontrolname!form!controlname!ForeColor=

RE: Can VBA change color of text on sub data sheet?

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.

RE: Can VBA change color of text on sub data sheet?

(OP)
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

RE: Can VBA change color of text on sub data sheet?

Forms![tablet subform].[Form].[Price].ForeColor = 255

RE: Can VBA change color of text on sub data sheet?

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?

RE: Can VBA change color of text on sub data sheet?

(OP)
specific row would do it...just some of the records showing in the sub data sheet...similar with conditional formatting

RE: Can VBA change color of text on sub data sheet?

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close