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

Conditional bold fields in report

Status
Not open for further replies.

TASY

Technical User
Jul 4, 2000
11
0
0
CA
Visit site
Hi all<br><br>I have created a report, with lots and lots of fields, most of which have a value of zero. Is there any way to make the fields that are NOT zero <b>bold</b>?? It would make them stand out a little nicer.<br><br>Thanks! <br>Tasmin Zimak
 
Well, I answered my own question!!<br><br>I wrote some code, which is at the end of this post, and attached it to the &quot;On Print&quot; event of the detail section of the report. <br><br><br><font color=purple><br>Dim text1 As Control, text2 As Control, text3 As Control, text4 As Control, text5 As Control<br><br>Set text1 = Me!SUSSEPT<br>Set text2 = Me!SUSOCT<br>Set text3 = Me!SUSNOV<br>Set text4 = Me!SUSDEC<br>Set text5 = Me!SUSJAN<br><br>If (Val(text1.Text) &lt;&gt; 0) Then<br>&nbsp;&nbsp;&nbsp;&nbsp;text1.FontBold = True<br>Else<br>&nbsp;&nbsp;&nbsp;&nbsp;text1.FontBold = False<br>End If<br><br></font><br> <p>Tasmin Zimak<br><a href=mailto:tzimak@board.ugdsb.on.ca>tzimak@board.ugdsb.on.ca</a><br><a href= > </a><br>
 
Do you think the same techinique could be used to change the color of a font conditionally on a form?<br><br>Drew
 
<br>Yes it can. Use it with the &quot;On Load&quot; event of the form. The property to change the colour is &quot;ForeColor&quot;. Other ones are &quot;FontSize&quot;, &quot;FontItalic&quot; and &quot;FontName&quot;.<br><br> <p>Tasmin Zimak<br><a href=mailto:tzimak@board.ugdsb.on.ca>tzimak@board.ugdsb.on.ca</a><br><a href= > </a><br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top