Change text color in report

S

stumpy

Is it possible to change the text color of a report field if an option button
is checked
in a form.
Form Printlabels has
option2 = red
option4 = blue
option6 = white

is it possible to change the forcolor of txtbox(text1)in report( rptlabels )
depending which option is chosen in form Printlabels

any help is appreciated
 
M

Marshall Barton

stumpy said:
Is it possible to change the text color of a report field if an option button
is checked
in a form.
Form Printlabels has
option2 = red
option4 = blue
option6 = white

is it possible to change the forcolor of txtbox(text1)in report( rptlabels )
depending which option is chosen in form Printlabels


Use a little VBA code in the report control's Format event
(or in this case you could use the report's Open event):

Select Case Forms![the form name.[the option frame]
Case 2
Me.[the report control].ForeColor = vbRed
Case 4
Me.[the report control].ForeColor = vbBlue
Case 6
Me.[the report control].ForeColor = vbWhite '?????
End Select

Are you sure your want white text for option 6? White text
on a white background is really difficult to read ;-)
 
S

stumpy

Many thanks Marshall

The labels to be print are of Avery labels type, on the form there is the
ability to import images (code found within previous postings) to print on
these labels.
If the image is dark hence the need for white text.

Marshall Barton said:
stumpy said:
Is it possible to change the text color of a report field if an option button
is checked
in a form.
Form Printlabels has
option2 = red
option4 = blue
option6 = white

is it possible to change the forcolor of txtbox(text1)in report( rptlabels )
depending which option is chosen in form Printlabels


Use a little VBA code in the report control's Format event
(or in this case you could use the report's Open event):

Select Case Forms![the form name.[the option frame]
Case 2
Me.[the report control].ForeColor = vbRed
Case 4
Me.[the report control].ForeColor = vbBlue
Case 6
Me.[the report control].ForeColor = vbWhite '?????
End Select

Are you sure your want white text for option 6? White text
on a white background is really difficult to read ;-)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top