formatting Access report

TiderInsider

New Member
Joined
May 18, 2004
Messages
27
Here is my delima: I am working on a function that will create a cross tab query and then a report based on that query. The only problem is the formatting of the report.

I want all the info to fit on one page and the number of columns will change from query to query. I also want to skip a line at a couple of times during the report.

Code:
My query:

Duration     0     5     10     15     Total

Quarter1     X     X      X       X        X
Quarter2     X     X      X       X        X
Quarter3     X     X      X       X        X
Quarter4     X     X      X       X        X
Year1        X     X      X       X        X
Quarter5     X     X      X       X        X
Quarter6     X     X      X       X        X
Quarter7     X     X      X       X        X
Quarter8     X     X      X       X        X
Year2        X     X      X       X        X
Year3        X     X      X       X        X
Year4        X     X      X       X        X
Year5        X     X      X       X        X

What I would like my report to look like

Duration     0     5     10     15     Total

Quarter1     X     X      X       X        X
Quarter2     X     X      X       X        X
Quarter3     X     X      X       X        X
Quarter4     X     X      X       X        X

Year1        X     X      X       X        X

Quarter5     X     X      X       X        X
Quarter6     X     X      X       X        X
Quarter7     X     X      X       X        X
Quarter8     X     X      X       X        X

Year2        X     X      X       X        X

Year3        X     X      X       X        X
Year4        X     X      X       X        X
Year5        X     X      X       X        X

Is this possible? What is the best approach to take to achieve this kind of formatting.

Thanks in advance for any help.
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Assuming you can get the basic layout in your report, you can play with the line spacing in the report code.
Report Design view, right-click Detail and select the Format event.
Double-click so you see [Event Procedure], then click the builder (...) at the right end of the line.
Now you're in the code area. Your cursor should be between
Sub Detail_Format and End Sub.
Now I'm guessing a bit -- you will need to dig a bit in the properties -- but you'll need something like this in the end:
Code:
Sub Detail_Format
  If Left([Duration],4)="Year" Then
    'write some code that doubles the line spacing
  End If
End Sub
HTH
Denis
 
Upvote 0
I think the code solution is quickest to accomplish exactly what you said.

but...

I'd be interested to see the source data table.

If I were correct in assuming year1,2.... is an aggregate of the respective quarters, you could use totals in the report by grouping on the year assuming that the year can be assigned to each row somehow.
 
Upvote 0
Year 1 and 2 are geometric average of the ratios listed in the quarters, so I could calculate them, but I am pulling these number straight from a mainframe .prn file, so my task is to manipulate the data given to me - not to calculate.
 
Upvote 0

Forum statistics

Threads
1,221,692
Messages
6,161,351
Members
451,697
Latest member
pedroDH

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top