Bolding text in the details section programatically

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello All

I am trying to programmatically text control boxes which meet certain conditions in the details section of my report. Right now it works, but I used a fairly 'brute force' method - I specifically refer to the control by name and set the FontBold property to True. I would like to be a little more sophisticated and (at least) use a for/next loop, set Me(intIndex).FontBold to True. The problem I'm running accros is that not all my controls support the FontBold property (I have pictures in each line.) How can I test Me(intIndex) to see if it supports FontBold? I figure there is an easy way to do this, but I'm not that experienced w/VBA

Thank you in advance!
 
You could select all the controls that you want to bold and view their
collective properties. Find the "Tag" property and add the word "BOLD". Then
use code in the On Format event of the section similar to:

Dim ctl as Control
For Each ctl In Me.Controls
If ctl.Tag = "BOLD" Then
ctl.FontBold = [your condition expression]
End If
Next

--
Duane Hookom
MS Access MVP


Nick M said:
Hello All,

I am trying to programmatically text control boxes which meet certain
conditions in the details section of my report. Right now it works, but I
used a fairly 'brute force' method - I specifically refer to the control by
name and set the FontBold property to True. I would like to be a little
more sophisticated and (at least) use a for/next loop, set
Me(intIndex).FontBold to True. The problem I'm running accros is that not
all my controls support the FontBold property (I have pictures in each
line.) How can I test Me(intIndex) to see if it supports FontBold? I
figure there is an easy way to do this, but I'm not that experienced w/VBA.
 
Back
Top