Calendar Report question for Duane

J

JB

Duane:

I am modifying a sample report from the BRDemos database from your
website. I am working with the rptShipRequiredDates from an Access97
sample. I have adapted everything to my needs but have run into a
problem. I have inserted an extra subreport that prints on the same
line as the daily date value.

A sample:

Nov Sweeps 6|Nov Sweeps 7|

This works fine when there is only one line in the subreport. The
problem comes when a date has two items in it, like this:

Nov Sweeps 24|
Thanksgiving

The subreports shrink and grow to adjust but the lines around the boxes
do not. If I have two events printing in the date heading the grow
feature is triggered and everything is one row taller. The line that
draws across the bottom of the boxes does not move and so there is a
gap and the boxes do not appear to have a bottom line. It only affects
the row of dates where there is a box with two items in it.

I looked at the code you use in the report but I am not sure what to
modify. I think it is what you are using to adjust the line but I am
not sure.

Can you help?
 
D

Duane Hookom

There is code in the On Print event of the detail section of the main
report. This code loops through the seven subreports to find out which one
has grown to the largest height. Then, code loops through drawing
lines/boxes around each of the seven subreports.

If you added another subreport, you need to modify the code to check the
grown height of the new subreport and also draw a box around it.
 
J

JB

Excellent. Thank you. That worked great. I have another question.

Some months print within 5 weeks. Others need 6 weeks to cover all of
the dates. I need to max out the size of the boxes to hold as much info
from the database as possible. My project requires that one month must
fit in one page.

How would I modify the report to change the height of one of the
subreports based on if 5 or 6 weeks print? I assume it would be based
on counting the number of rows in the table ttblWeekOf, but I am not
sure how to approach it.
 
D

Duane Hookom

You can't change the height of the subreports since they are set to allow
growing. You should be able to count the number of displayed weeks but I
don't know what good that number is to you.
 
J

JB

So how can I approach it? Or are you saying there is no way to do it in
one report?

If I manually increase the physical height of the subreport in the
design view, then I max out the report page space for a 5 week month.
As soon as I have a 6 week month, the report goes to a second page. Can
I dynamically make that adjustment somewhere? Otherwise I have to use
the smaller subreport size in case of a 6 week month and there is an
inch of space at the bottom of the page I do not use for the months
with only 5 weeks.

Should I have two different reports and the VBA on the controlling form
determines which report layout to use based on the number of weeks in
the month?
 
D

Duane Hookom

The report should have the design height of the subreports set to a minimal
size. They grow as needed.
 

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