Height and Top Margin Changes rest of report

C

Chuck

Hello,
I have a report based on a query that has 10 rows with specific text that I
would like to have special formatting. Such as increase both the row spacing
and font size.
In the Report On Format Event I check for the text and then use the Height
and TopMargin to do this.
My problem is that the remainder of the report now has those settings and I
would like to get it back to Font of 10 with single spacing.
Is there a way to set the balance of the rows back to the report default?
Here is my code for one of the 10 special rows.

If Heading = "Income Received for Fiscal Year" Then
Me.Heading.FontSize = 12
Me.Heading.ForeColor = 0
Me.Heading.Height = 500
Me.Heading.TopMargin = 150
Me.YTD.FontSize = 12
Me.YTD.ForeColor = 0
Me.YTD.Height = 500
Me.YTD.TopMargin = 150
Me.Mth.Height = 500
Me.Mth.TopMargin = 150
Me.Mth.FontSize = 12
End If
Thanks
Chuck
 
J

John Spencer

You would have to have code to reset whenever the line is supposed to be
normal. There is no Set To Default capability.

One easy way to handle this (though it might slow things down is to set the
properties to the normal every time and then handle the differnt cases. Or
use a case statement if the change is always based on heading value

SELECT Case Heading
Case "Income Received for Fiscal Year"
Me.Heading.FontSize = 12
Me.Heading.ForeColor = 0
Me.Heading.Height = 500
Me.Heading.TopMargin = 150
...
Case "Radically different Heading"
Me.Heading
....
Case ...
...
Case Else 'Normal settings
Me.Heading.FontSize = 10
...
END Select

You might be able to avoid the running the normal code if you are always
changing the FontSize of Heading to something other than 10 by checking the
font size of Heading and if it is not 10 then update the normal settings if
you get to Case else.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 
C

Chuck

Thank You John.
I tried the Case and all rows above the last cahnge are ok but the rows
after the last change are still wide.
Is there a format command beside " Height" that I need?
Thanks
Chuck
 
J

John Spencer

Have you set the can shrink property of the section to Yes (true)?

You still have not shown all your code, so it is difficult to say what is
wrong. I assume you mean the height of the section is too big and not the
width. There is very little you can do to change the width.

John Spencer
Access MVP 2002-2005, 2007-2010
The Hilltop Institute
University of Maryland Baltimore County
 

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