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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Button to print two reports 1

Status
Not open for further replies.

McFestoe

Technical User
Dec 16, 2003
145
GB
I have the following behind a button that brings the report up on the screen.


Dim strWhere As String
strWhere = "[ID]=" & Me.ID
DoCmd.OpenReport "Keyholder to Cust", acViewPreview, , strWhere
End Sub

iam i right in thinking if i change the DoCmd to

DoCmd.Openreport "Report 1", Report 2", acprint,,strWhere

That this would run two reports and send them straight to the printer?

Thanks in advance
 
No but this would do that:

Code:
DoCmd.Openreport "Report 1", acprint,,strWhere
DoCmd.Openreport "Report 2", acprint,,strWhere

Post back if you have any questions.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Scriverb

Thanks for the help once again........
 
Scriverb,

Sorry to post back, i have been trying to sort this out on my own and dont understand the message iam getting from the following code.

Private Sub Command374_Click()

Dim strWhere As String
strWhere = "[ID]=" & Me.ID
DoCmd.OpenReport "Paperwork Checklist", acPrint, , strWhere
DoCmd.OpenReport "Paperwork Handover", acPrint, , strWhere


End Sub

WIth the above i get Complie error: Variable not defined (highlighted acPrint)

With the following it works and brings the reports on screen then we select print, i wanted to automate this process, also is there a way to ask the user either to view on screen or print (just a idea that has come to me)

Private Sub Command374_Click()

Dim strWhere As String
strWhere = "[ID]=" & Me.ID
DoCmd.OpenReport "Paperwork Checklist", acViewPreview, , strWhere
DoCmd.OpenReport "Paperwork Handover", acViewPreview, , strWhere


End Sub

Thanks again

Richard
 
You are using the wrong argument setting. Use the following:

From ACCESS Help:
acViewNormal prints the report immediately. If you leave this argument blank, the default constant (acViewNormal) is assumed.

Good luck.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Scriver,

Sorry to be a pain....

Could you explain what acPrint does i assumed it was for printing and in other parts of the db i have used acPrint and it works fine,

If i try something will you have a look at it just got a idea?

Richard
 
I have always used acViewNormal or left the argument blank so that the default acViewNormal was used. acPrint may be from another function but not this one that I know of.

[COLOR=006633]Bob Scriver[/color]
MIState1.gif
[COLOR=white 006633]MSU Spartan[/color]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top