column width changes report header width

column width changes report header width

Post by am1vb3J » Sun, 23 Aug 2009 01:48:01


I am posting this a second time hoping this subject explains my problem
better and someone can help.

I would like to have the detail section display only 2 inches wide with an
alternating back color. I tried to do this by setting the page layout as a
single column. This displays the data correctly, but the report
header/footer are
cut off. If I leave the page set up without a column, the alternating back
color spans the entire width of the report, about 7.5 inches. Is there a
way to have
alternating back color only behind the text boxes? Or, a way to identify a
single column width that will not change the report header width. Thank you!
 
 
 

column width changes report header width

Post by Q2xpZmZvcm » Sun, 23 Aug 2009 04:32:02

Hi,

Set the Detail section's Alternate Back Color to No Color. Add a text
box to your detail section that is two inches wide and takes up the entire
height of the detail section. Set the Back Style to Normal and the Border
Style to Transparent. Set the Border Width Hairline. Give it a name (i.e.
txtBackground), set its Control Source to =1 and set Running Sum to Over All
or Over Group, depending on your needs. Send the text box to the back,
behind all other controls in the detail section. Create an On Format event
for the detail section and place code in it that will change the color as
desired depending on the value of the control.

Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)

If txtBackground.Value Mod 2 = 0 Then
' Even row
txtBackground.BackColor = RGB(255, 128, 0)
Else
' Odd row
txtBackground.BackColor = RGB(0, 128, 255)
End If

End Sub

Hope that helps,

Clifford Bass