Multiple pages in report.

sdawson

Registered User.
Local time
Today, 11:19
Joined
Apr 22, 2003
Messages
165
I have created a chart in a report and on printing the default is to print duplicate pages corresponding to the number of data series!
How do I get rid of this.

I'm using:-
DoCmd.OpenReport strDocName, acPreview, , strCriteria
DoCmd.RunCommand acCmdPrint

to bring up the standard Print dialogue box and have to manually input Print 1 To 1 pages.

Help!:(
 
why don't you try

Code:
DoCmd.OpenReport strDocName, [B]acNormal[/B], , strCriteria

instead - this way it goes straight to the printer?
 
That code is fine if you want to print to a default printer, which I do not.
I need the factility for a user to send the report to any one of a number of networked printers that is why I use the code I do.
Your code still does not address the problem of printing duplicates.
Thanks anyway.

Any other takers?
 
I hate to be primitive, but you can always cheat and use Sendkeys to change any of the defaults.
Code:
SendKeys "{TAB 2}{DOWN}{TAB}1{TAB}1{TAB}1", False
This will automatically set Page 1 of 1. You can use your own mix to accomplish what ever you want.

It's cheating, I know, but at least it can work.
 
Always a good standby, Sendkeys.
In this instance it will not work.

Thanks
 
Why not? I'm obviously missing something here. What are you trying to accomplish exactly? If what you are trying to do is get it to automatically set Print 1 To 1, you can use SendKeys. If not, please explain it a little better.
 
The basic problem is "why does my report contain 7 identical pages?".
Until I find the answer to this question and fix it I'm stuck with printing Page 1 To 1.

My code for this is:-

DoCmd.OpenReport strDocName, acPreview, , strCriteria
DoCmd.RunCommand acCmdPrint

The Sendkeys command needs to come after the second line when the standard MS print dialogue box is visible.
The problem is the Sendkeys command will not execute until the OK button has been clicked on the Print dialogue. The Sendkeys command then has no effect as the command to print has already been sent to the printer! unless I'm missing something?
 
As far as the duplicate pages go, please explain a little more what data your report contains.

As far as SendKeys, you need to place the SendKeys command before the print command.
Code:
DoCmd.OpenReport strDocName, acPreview, , strCriteria
SendKeys "{TAB 2}{DOWN}{TAB}1{TAB}1{TAB}1", False
DoCmd.RunCommand acCmdPrint
 
My apologies Shuie, it works fine now.
 
I'm still interested in what your data set is to try and determine why it is printing multiple pages to begin with.
 
excerpt from db attached.
Open the report, when it asks for a date start and finish, put in about 3 months in 2006
say 01/01/06 to 31/03/06
 

Attachments

Thank you for posting your dbase. The answer to your question is quite simple. The dynamics of the 'Detail' section of a report are such that the detail section is replicated for each record returned by your query. Given that this is the case, and since you bound your report to your query, it is returning a recordset with a lot of records (depending on the date range) and therefore repeating the detail section for each one of those records.

There are a couple of things I would have done differently if you were starting from scratch, but once you did it this way, the simple fix is to cut the charts out of the detail section and place them in the report footer, and then shrink the detail section to nothing.

BTW, your first two queries are not calculating any aggregate values, so I would remove the "Group By" clause in those queries.
 
Your a star Shuie. Thanks for your tips.
 

Users who are viewing this thread

Back
Top Bottom