Alternate gray and white- Jeff C 3rd questions

S

Stephanie

Hi. I was warned about line wrapping and sure enough! My
report is landscape and I want the gray shading to go
across the entire page, so I used method 1:

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

I tried to manipulate my fields on the form, but it does
seem that the gray shading is was is causing the line
wrap. Help stop line wrapping! Any suggestions for
fixing the report (I know nothing about coding in reports
so I appreciate the details). Thanks, Stephanie
 
F

fredg

Hi. I was warned about line wrapping and sure enough! My
report is landscape and I want the gray shading to go
across the entire page, so I used method 1:

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

I tried to manipulate my fields on the form, but it does
seem that the gray shading is was is causing the line
wrap. Help stop line wrapping! Any suggestions for
fixing the report (I know nothing about coding in reports
so I appreciate the details). Thanks, Stephanie

There is nothing in this code that will cause a line to wrap.
Your problem is elsewhere.
I suspect any reference to line wrapping in someone's previous post to
you referred to the improper line wrapping that occurs in sending
these emails, and that you should be aware of incorrect line breaks
when copying and pasting code.

Try setting your control's Can Grow property to No.
Also the Detail Section Can Grow to No.
 
J

Jeff Conrad

Hi again Stephanie,

As Fred has pointed out there is a miscommunication on terms here.
When I meant "line wrapping" that means the code I posted may
get wrapped onto several lines by the newsreader. You would have
to correct any line breaks if you simply copied and pasted that into
report code module.

For example, this line which you just posted:

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

.....should all be one line in the code window like so:

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

(Although it still may get wrapped again)

If there were improper line breaks in your code then the code would be
highlighted in red AND errors would occur when you try and run the report.
This does not *appear* to be the case here. It sounds like the Detail
section is growing with the information in the controls.

Try following Fred's suggestions and see if that helps. If not, please
provide a little bit more detail on what *exactly* is happening.
 
S

Stephanie

Gotta ya!
I did get the report to print on one page- thanks for the
help.
Could you suggest other "grays"- 15724527 is a bit
light. How do you know the secret code for shading color?
Thanks,
Stephanie
 
F

fredg

Gotta ya!
I did get the report to print on one page- thanks for the
help.
Could you suggest other "grays"- 15724527 is a bit
light. How do you know the secret code for shading color?
Thanks,
Stephanie

The easiest way (for me) to get a color value number, is to open any
form or report, click on any color property of whatever control is
handy and change that color to the one you want, using the color tool
button. Then read that color value from the property sheet.
Some additional gray color values are:
12632256
9868950
8421504

Don't forget to NOT save the changes to that control.<g>

By the way, if the color shade is not already on the color toolbutton,
just click on the property sheet button with the 3 dots that will open
the color table and allow for you to create your own custom color.
 
J

Jeff Conrad

Hi Stephanie,

Here is a little trick I use to get the color numbers.

1. Create a new blank form (could even be in a dummy database)

2. Go to Design View and right-click on the Detail area.

3. Select Properties from the menu that will appear.

4. On the Format or All tabs look for the option called "Back Color."
Click on the that line and then click the (...) button just to the right of it.
This will bring up the windows color picker form.

5. Click on the gray color first and then click the "Define Custom Colors"
button. From here, try and find a color that would suit your needs.
Use the slider control on the right side as well if you wish.

6. Once you find a good color hit the "Add to Custom Colors" button.
The color you selected will now show in the "Custom Colors" section.

7. Now click in the color box that has the new color and then click OK.
The background color of the form will show this color. The color
'number' will show in the Back Color Property line now. Just write it
down or copy/paste the number into the report's code module.

Just keep experimenting until you get the color you would like.
 
S

Stephanie

Thanks so much- I'll give it a try. The report looks
great, thanks to you! And you're right- reports are
where it's at! Cheers, Stephanie
 

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