Suppressing Details

  • Thread starter Thread starter Erin
  • Start date Start date
E

Erin

Hi All,

Is there a way to suppress details for a specific group?
For instance I want my report to read:

Class A
Class A Details
Class A Details
Class A Details
Total Class A

Total Class B

Grand Total

So that the reader can see the detail for Class A, but not
for Class B. Any suggestions would be appreciated.
Thanks.
 
Erin said:
Hi All,

Is there a way to suppress details for a specific group?
For instance I want my report to read:

Class A
Class A Details
Class A Details
Class A Details
Total Class A

Total Class B

Grand Total

So that the reader can see the detail for Class A, but not
for Class B. Any suggestions would be appreciated.
Thanks.

In the Format event for the Detail section...

Cancel = ([Class] = "Class B")
 
Rick,

Thanks for your help, but I'm doing something wrong.

I tried typing Cancel = ([CATEGORY] = "Political
Contributions") directly into the Event Format box
(CATEGORY is the name of the field where Political
Contributions may be found), but I recieved an error
message "Microsoft Access can't find the macro Cancel =
([CATEGORY] = "Political Contributions").""

Then I tried putting it in the code as follows:

Private Sub Detail1_Format(Cancel As Integer, FormatCount
As Integer)
Cancel = ([CATEGORY] = "Political Contributions")
End Sub

but then I got the error message "Microsoft Access can't
find the field 'CATEGORY' in your expression.

Any idea what I'm doing wrong? I appreciate you help.
Thanks.
-----Original Message-----
Erin said:
Hi All,

Is there a way to suppress details for a specific group?
For instance I want my report to read:

Class A
Class A Details
Class A Details
Class A Details
Total Class A

Total Class B

Grand Total

So that the reader can see the detail for Class A, but not
for Class B. Any suggestions would be appreciated.
Thanks.

In the Format event for the Detail section...

Cancel = ([Class] = "Class B")


.
 
Erin said:
Rick,

Thanks for your help, but I'm doing something wrong.

I tried typing Cancel = ([CATEGORY] = "Political
Contributions") directly into the Event Format box
(CATEGORY is the name of the field where Political
Contributions may be found), but I recieved an error
message "Microsoft Access can't find the macro Cancel =
([CATEGORY] = "Political Contributions").""

This is definitely wrong. You need the entry "[Event Procedure]" in the property box
and then add code to the module as you do below.
Then I tried putting it in the code as follows:

Private Sub Detail1_Format(Cancel As Integer, FormatCount
As Integer)
Cancel = ([CATEGORY] = "Political Contributions")
End Sub

but then I got the error message "Microsoft Access can't
find the field 'CATEGORY' in your expression.

Any idea what I'm doing wrong? I appreciate you help.
Thanks.

This looks ok to me. Code behind reports can't make references to fields in the
report's RecordSet unless those fields are actually used in a control on the report.
Is the field [CATEGORY] referenced in a control somewhere on the report? If not just
add a hidden control using that field as the ControlSource and then the code should
be able to pick it up.
 
Rick,

There was such a control in the report, but apparently it
needed to be in the detail section. Once I added one
there it worked. Thanks much for your help.

Erin
-----Original Message-----
Erin said:
Rick,

Thanks for your help, but I'm doing something wrong.

I tried typing Cancel = ([CATEGORY] = "Political
Contributions") directly into the Event Format box
(CATEGORY is the name of the field where Political
Contributions may be found), but I recieved an error
message "Microsoft Access can't find the macro Cancel =
([CATEGORY] = "Political Contributions").""

This is definitely wrong. You need the entry "[Event
Procedure]" in the property box
and then add code to the module as you do below.
Then I tried putting it in the code as follows:

Private Sub Detail1_Format(Cancel As Integer, FormatCount
As Integer)
Cancel = ([CATEGORY] = "Political Contributions")
End Sub

but then I got the error message "Microsoft Access can't
find the field 'CATEGORY' in your expression.

Any idea what I'm doing wrong? I appreciate you help.
Thanks.

This looks ok to me. Code behind reports can't make references to fields in the
report's RecordSet unless those fields are actually used in a control on the report.
Is the field [CATEGORY] referenced in a control somewhere on the report? If not just
add a hidden control using that field as the
ControlSource and then the code should
 
Back
Top