By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,220 Members | 1,633 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,220 IT Pros & Developers. It's quick & easy.

Problems with group and report footer

P: n/a
Hello
I have a report, which lists records. Each record has money paid
field. Money paid can be 0 or not 0. I calculate and print summary of
money for a group in the group footer, as well as summary of money for
all groups the report footer. When there is at least one record with
money >0, group and report footers are appropriate and look OK.
When all records are with 0 money, footers look silly. I’d like
not to print them. I have placed a code into the group footer:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As
Integer)
If [Total Payment] = "" Then
[GroupFooter1].Visible = False
Else
[GroupFooter1].Visible = True
End If
End Sub
Footer is not printed, but the problem is that it contains a
horizontal line, which should be printed after the last record. Line
is not printed as well. The report looks silly with columns divided by
vertical lines ending in the middle of the page. The horizontal line
is to make the report looking as a form.
How can I print a horizontal line in the after details section and not
print group footer?
There is another problem with the report footer. It is printed on a
separate page. The code is in OnFormat event:
Private Sub ReportFooter4_Format(Cancel As Integer, FormatCount As
Integer)
If [All total payment] = "" Then _
Cancel = 1
End Sub
The footer is not printed, but the empty page is still there! How can
I remove this empty page?
Thank you very much for all your help.
Galina
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Hi Galina

Your first problem could be solved more simply without the use of VBA. I
assume that when all records are with 0 money, your summary information also
equals 0. If that is the case then perhaps your totals could make use of an
IIf statement to null themselves out. For example:

=IIf(Sum(Money)=0,Null,Sum(Money)

If something like this were placed in the controls used to display the
totals, and the control's 'Can Shrink' property is set to 'Yes', then the
controls displaying the summary data would become invisible if they were all
0, but the footer (and also your horizontal line) would remain.

Perhaps this approach will solve your second problem too.

hth

~Ben

"Galina" <ga*********@cityofbristol.ac.uk> wrote in message
news:cc**************************@posting.google.c om...
Hello
I have a report, which lists records. Each record has money paid
field. Money paid can be 0 or not 0. I calculate and print summary of
money for a group in the group footer, as well as summary of money for
all groups the report footer. When there is at least one record with
money >0, group and report footers are appropriate and look OK.
When all records are with 0 money, footers look silly. I’d like
not to print them. I have placed a code into the group footer:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As
Integer)
If [Total Payment] = "" Then
[GroupFooter1].Visible = False
Else
[GroupFooter1].Visible = True
End If
End Sub
Footer is not printed, but the problem is that it contains a
horizontal line, which should be printed after the last record. Line
is not printed as well. The report looks silly with columns divided by
vertical lines ending in the middle of the page. The horizontal line
is to make the report looking as a form.
How can I print a horizontal line in the after details section and not
print group footer?
There is another problem with the report footer. It is printed on a
separate page. The code is in OnFormat event:
Private Sub ReportFooter4_Format(Cancel As Integer, FormatCount As
Integer)
If [All total payment] = "" Then _
Cancel = 1
End Sub
The footer is not printed, but the empty page is still there! How can
I remove this empty page?
Thank you very much for all your help.
Galina

Nov 12 '05 #2

P: n/a
Ben
It is an interesting idea and it would have worked, but each control
has got a label. Shrinking of the control will not shrink label...

I can make all labels and controls invisible, if Sum([Money])=0. I
just wanted to check, if there is a cleverer way, then to write
<Label>.Visible = False tens of times.

I'll use your idea in the reports, where controls in footers do not
have own labels.
Thank you very much.
Galina
"Ben Eaton" <do********@madeupaddress.com> wrote in message news:<bn**********@news.wplus.net>...
Hi Galina

Your first problem could be solved more simply without the use of VBA. I
assume that when all records are with 0 money, your summary information also
equals 0. If that is the case then perhaps your totals could make use of an
IIf statement to null themselves out. For example:

=IIf(Sum(Money)=0,Null,Sum(Money)

If something like this were placed in the controls used to display the
totals, and the control's 'Can Shrink' property is set to 'Yes', then the
controls displaying the summary data would become invisible if they were all
0, but the footer (and also your horizontal line) would remain.

Perhaps this approach will solve your second problem too.

hth

~Ben

"Galina" <ga*********@cityofbristol.ac.uk> wrote in message
news:cc**************************@posting.google.c om...
Hello
I have a report, which lists records. Each record has money paid
field. Money paid can be 0 or not 0. I calculate and print summary of
money for a group in the group footer, as well as summary of money for
all groups the report footer. When there is at least one record with
money >0, group and report footers are appropriate and look OK.
When all records are with 0 money, footers look silly. I’d like
not to print them. I have placed a code into the group footer:
Private Sub GroupFooter1_Format(Cancel As Integer, FormatCount As
Integer)
If [Total Payment] = "" Then
[GroupFooter1].Visible = False
Else
[GroupFooter1].Visible = True
End If
End Sub
Footer is not printed, but the problem is that it contains a
horizontal line, which should be printed after the last record. Line
is not printed as well. The report looks silly with columns divided by
vertical lines ending in the middle of the page. The horizontal line
is to make the report looking as a form.
How can I print a horizontal line in the after details section and not
print group footer?
There is another problem with the report footer. It is printed on a
separate page. The code is in OnFormat event:
Private Sub ReportFooter4_Format(Cancel As Integer, FormatCount As
Integer)
If [All total payment] = "" Then _
Cancel = 1
End Sub
The footer is not printed, but the empty page is still there! How can
I remove this empty page?
Thank you very much for all your help.
Galina

Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.