Group Footer

B

BOONER

How can I make a group footer only visible if the detail section contains
more than one record. I don't want to see my totals at the bottom of each
group if the group only contains one record.
 
M

Marshall Barton

BOONER said:
How can I make a group footer only visible if the detail section contains
more than one record. I don't want to see my totals at the bottom of each
group if the group only contains one record.


Add a text box named txtLineCnt to the group footer section
and set its Control Source expression to =Count(*)

Then use this line of code in the footer section's Format
event procedure:
Cancel = (Me.txtLineCnt = 1)
 
B

BOONER

Marshall Barton said:
Add a text box named txtLineCnt to the group footer section
and set its Control Source expression to =Count(*)

Then use this line of code in the footer section's Format
event procedure:
Cancel = (Me.txtLineCnt = 1)

I am getting the error "The object doesn't contain the automation object
'Cancel'
 
M

Marshall Barton

Since I can't imagine how that error can occur if you used
it as written in the place I said to put it. There's pny a
couple of things I can guess at.

Maybe you put it in the OnFormat property, instead of the
Format event procedure?

Maybe you put it in the Format event procedure, but modified
the code in an inappropriate way?
 
B

BOONER

Thanks a lot Marshall.

I was placing the code in the On Format Property instead of the event
procedure.

Marshall Barton said:
Since I can't imagine how that error can occur if you used
it as written in the place I said to put it. There's pny a
couple of things I can guess at.

Maybe you put it in the OnFormat property, instead of the
Format event procedure?

Maybe you put it in the Format event procedure, but modified
the code in an inappropriate way?
--
Marsh
MVP [MS Access]

I am getting the error "The object doesn't contain the automation object
'Cancel'
 

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