Shadebox to grow with memo textbox

G

george 16-17

Greetings all,

I have a report that the detail section is set to shade every other record
via conditional formatting using the expression: ([txtShadeBox] Mod 2) which
works fine. The shade box is positioned behind transparent text boxes.

The issue is that the shade box does not grow with a memo text box that is
set to "can grow". Therefore only half the record is shaded. Is there a
method to set the shade box height to the can grow height of the memo text
box?

Hope this makes sense and thanks in advance,
george
 
G

george 16-17

Hi Duane,

Thanks for point me in the right direction. This code posted by Jeff Conrad
did the trick:
http://www.microsoft.com/office/com...&p=1&tid=40da4485-48a6-4c98-9133-8d57ffa04ce5

First Way: Full Detail Section colored
(Learned from FredG I think)
Watch out for possible line wrapping here!

1. Code the Detail part of your report like this:
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
If Me.Section(0).BackColor = vbWhite Then
Me.Section(0).BackColor = 15724527
Else
Me.Section(0).BackColor = vbWhite
End If
End Sub

2. Now Code the Page Header part of your report like this
to start a new page with white (I think that's correct).

Private Sub PageHeader_Format(Cancel As Integer, FormatCount As Integer)
Me.Detail.BackColor = 16777215
End Sub

Much appreicated!
george
 

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