Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to specify pages to print in acviewnormal mode

Status
Not open for further replies.

cpdjimmy

Programmer
Apr 23, 2003
3
US
How do i specify certain pages to print using the normal view??

heres what i have that works but it always load up a preview of the report to print which takes too long

DoCmd.OpenReport "CPDReport", acViewNormal, "", "[DISCLOSURE_TABLE]![ID]=[Forms]![DISCLOSURE_ENTRY_FORM]![ID]"
DoCmd.SelectObject acReport, "CPDReport" // Error!!
DoCmd.PrintOut acPages, 2, 15, acMedium, Me![CopiesToPrint], True
DoCmd.Close acReport, "CPDReport", acSaveNo

But if i change the acviewnormal, i get an error at line Error!! that says "The object CPDReport is not open"

please help.. thanks in advance
Jimmy
 
I meant i have it currently as:
DoCmd.OpenReport "CPDReport", acViewPreview, "", "[DISCLOSURE_TABLE]![ID]=[Forms]![DISCLOSURE_ENTRY_FORM]![ID]"
DoCmd.SelectObject acReport, "CPDReport"
DoCmd.PrintOut acPages, 2, 15, acMedium, Me![CopiesToPrint], True
DoCmd.Close acReport, "CPDReport", acSaveNo

and would like to change acViewPreview to acViewNormal to speed up printing.

thanks jimmy
 
when you open the report with acviewnormal, it Opens, Prints, then closes the report. so it won't be open for your next commands.

can you put your criteria (ID = forms!blah!ID) into the recordsource of the report itself?

then you'd just have
DoCmd.SelectObject acReport, "CPDReport" ,TRUE
DoCmd.PrintOut acPages, 2, 15, acMedium, Me![CopiesToPrint], True

adding TRUE in the selectobject code means it's in the database window, that it's not already open.


 
I usually prefer to set up report recordsources to generate ONLY information which is relevant, and just let it print directly. This is accomplished in a variety of approaches, but an easy one is to make the report recordsource be a parameter query, obtaining the parameter(s) from (preferebly) some Form control(s), Global memory variables or (less gracefully) simple user input response to the pop-up requests for the value(s).



MichaelRed
m.red@att.net

Searching for employment in all the wrong places
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top