report page breaks

R

Russ

Access 2k. I'm trying to page a report with 500 entries per page. I
followed the help instructions including making two macros, one
conditional [Counter]=500 that change the Visible attribute, and
assigned them to the On Format event of the report page header and
detail header.

When I run the report, I get the following message:

The object doesn't contain the Automation object 'Counter.'
You tried to run a Visual Basic procedure to set a property or method
for an object. However, the component doesn't make the property or
method available for Automatic operations.
Check the component's documentation for information on the properties
and methods it makes available for Automation operations.


Can anyone decifer this message?

Thanks, Russ
 
S

S.Clark

I don't know what help file you are referring. If you right-click on the
Help Page, you may have a 'Copy Topic ID' option. Also, you can choose
properties and get the URL (e.g.
ms-help://MS.MSACCESS.12.1033/MSACCESS/content/HA10064450.htm)

Anyway, it sounds like you are trying to refer to an object called
'Counter'. This object may be a variable, a field, a control on the report
(e.g. the pagebreak control), or something else. Is there something on the
report defined as Counter?
 
R

Russ

Good answer. I fiddled with it a bit and instead of using the Help
file's [Counter] I used a field name. Presto! Unfortunately, I want
it to have a page break at each group of 500 ie. 500, 1000, 1500 etc,
and it won't do that with my [fieldname]=500 setup.



I don't know what help file you are referring. If you right-click on the
Help Page, you may have a 'Copy Topic ID' option. Also, you can choose
properties and get the URL (e.g.
ms-help://MS.MSACCESS.12.1033/MSACCESS/content/HA10064450.htm)

Anyway, it sounds like you are trying to refer to an object called
'Counter'. This object may be a variable, a field, a control on the report
(e.g. the pagebreak control), or something else. Is there something on the
report defined as Counter?

Russ said:
Access 2k. I'm trying to page a report with 500 entries per page. I
followed the help instructions including making two macros, one
conditional [Counter]=500 that change the Visible attribute, and
assigned them to the On Format event of the report page header and
detail header.

When I run the report, I get the following message:

The object doesn't contain the Automation object 'Counter.'
You tried to run a Visual Basic procedure to set a property or method
for an object. However, the component doesn't make the property or
method available for Automatic operations.
Check the component's documentation for information on the properties
and methods it makes available for Automation operations.


Can anyone decifer this message?

Thanks, Russ
 
R

Russ

Steven,

Here is the help file:

On the last line it claims that the macro waits for the condition to
be met again. However, the page does not break at 1000, 1500 etc.

Russ




Use a macro to force a page break in a report if a condition is met
Open the report in Design view.

In the toolbox, click Page Break , and then click in the report
section where you want a conditional page break.

Click Properties on the toolbar, and specify a name for the page
break control in the Name box.

Create a macro.
How?

In a blank action row, click SetValue in the action list.

Set the Item argument to the identifier for the Visible property of
the page break control. For example, if the name of the control is
CondPgBreak, set the Item argument to [CondPgBreak].[Visible].

Set the Expression argument to No.

Click Save to save the macro.

In report Design view, set the OnFormat property of the report's page
header section to the name of the macro.
This hides the page break control when the report starts formatting
each page, so the page doesn't break.

Create a second macro that sets the Visible property of the page break
control to Yes when a conditional expression is met.

Click Save to save the macro.

Select the section where you placed the page break, and set the
section's OnFormat property to the name of the second macro. In the
preceding example, to make a page break occur if the Counter control
in the detail section is 10, set the detail section's OnFormat
property to the name of the second macro.
When the condition is met, the page breaks. After the page is broken,
the macro attached to the page header hides the page break control
until the condition is met again.



I don't know what help file you are referring. If you right-click on the
Help Page, you may have a 'Copy Topic ID' option. Also, you can choose
properties and get the URL (e.g.
ms-help://MS.MSACCESS.12.1033/MSACCESS/content/HA10064450.htm)

Anyway, it sounds like you are trying to refer to an object called
'Counter'. This object may be a variable, a field, a control on the report
(e.g. the pagebreak control), or something else. Is there something on the
report defined as Counter?

Russ said:
Access 2k. I'm trying to page a report with 500 entries per page. I
followed the help instructions including making two macros, one
conditional [Counter]=500 that change the Visible attribute, and
assigned them to the On Format event of the report page header and
detail header.

When I run the report, I get the following message:

The object doesn't contain the Automation object 'Counter.'
You tried to run a Visual Basic procedure to set a property or method
for an object. However, the component doesn't make the property or
method available for Automatic operations.
Check the component's documentation for information on the properties
and methods it makes available for Automation operations.


Can anyone decifer this message?

Thanks, Russ
 
S

S.Clark

I don't really do macros that much, as VBA is so much mo betta.

But, the gist is that you need some type of sequential, self-assigning value
(i.e. Counter) that knows what record you are on. If that is your
[Fieldname], then how is it being populated and incremented? Where are you
using the [fieldname]=500, and how does it affect the page break control?

Russ said:
Good answer. I fiddled with it a bit and instead of using the Help
file's [Counter] I used a field name. Presto! Unfortunately, I want
it to have a page break at each group of 500 ie. 500, 1000, 1500 etc,
and it won't do that with my [fieldname]=500 setup.



I don't know what help file you are referring. If you right-click on the
Help Page, you may have a 'Copy Topic ID' option. Also, you can choose
properties and get the URL (e.g.
ms-help://MS.MSACCESS.12.1033/MSACCESS/content/HA10064450.htm)

Anyway, it sounds like you are trying to refer to an object called
'Counter'. This object may be a variable, a field, a control on the report
(e.g. the pagebreak control), or something else. Is there something on the
report defined as Counter?

Russ said:
Access 2k. I'm trying to page a report with 500 entries per page. I
followed the help instructions including making two macros, one
conditional [Counter]=500 that change the Visible attribute, and
assigned them to the On Format event of the report page header and
detail header.

When I run the report, I get the following message:

The object doesn't contain the Automation object 'Counter.'
You tried to run a Visual Basic procedure to set a property or method
for an object. However, the component doesn't make the property or
method available for Automatic operations.
Check the component's documentation for information on the properties
and methods it makes available for Automation operations.


Can anyone decifer this message?

Thanks, Russ
 

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