Printing only first page of a report

alcide

New member
Local time
Today, 15:47
Joined
Nov 18, 2005
Messages
5
I have a button on a form. Pushing the button starts printing a report containing the current record that was on the form.

This record has many fields, so that it prints about 4 pages of text.

It is only the first page that i want to be printed.

Code is like this:

Private Sub cmd_Controle1Druk_Click()
On Error GoTo Err_cmd_Controle1Druk_Click

Dim stDocName As String
Dim stLinkCriteria As String
stDocName = "rpt_Controle1"

stLinkCriteria = "[vld_Id]=" & Me![vld_Id1]


DoCmd.OpenReport stDocName, acPreview, stLinkCriteria


Exit_cmd_Controle1Druk_Click:
Exit Sub

Err_cmd_Controle1Druk_Click:
MsgBox Err.Description
Resume Exit_cmd_Controle1Druk_Click

End Sub
 
DoCmd.SelectObject acReport, strReportName ' required to close the object
DoCmd.PrintOut acPages, 1, 1
 
Hello everybody,
I have a command button on a form to print some reports in the same time. But some pages in some reports to be needed printing out for saving . For example :
+ With 4 reports in my database to be printed in the same time by command coding.
- Report 1 with 20 pages from page 1 to page 20
- Report 2 with 12 pages from page 1 to page 12
- Report 3 with 18 pages from page 1 to page 18
- Report 1 with 16 pages from page 1 to page 16
And now I want to print as below description :
- Print Report 1 : from page 1 to page 8 and page 15 to page 20.
- Print Report 2 : from page 1 to page 6 and page 9 to page 12.
- Print Report 1 : from page 1 to page 10 and page 13 to page 18.
- Print Report 1 : from page 1 to page 12 and page 15 to page 16.
Would you like to help me for doing this by coding .
Thank you very much.
MichealDon.
 
Last edited:
Dear Gasman,
Thank you very much.
Best Regards,
MichealDon
 
The request to print ranges as you have defined is suspect at best. Are you sure you want to print specific pages? Wouldn't it be more likely that you want to choose what to print based on the data? So maybe you want to print data for department 12. Today that is on pages 8-11. Tomorrow it might be 9-12.
 

Users who are viewing this thread

Back
Top Bottom