Hi!
How to define number of copies on printig. My code is:
Private Sub PrintInv()
Dim strDocName As String
Dim strWhere As String
strDocName = "Invoice"
strWhere = "OrderNr=" & Me!OrderNr
DoCmd.OpenReport strDocName, acViewNormal, , strWhere, acHidden, 2
End Sub
This procedure prints only 1 copy instead of 2. How I should change code to
get 2 copies?

Signature
Have a Nice Day!
strive4peace - 30 Apr 2008 20:16 GMT
hi Mark,
here is one way:
make the following table:
Numbers
- Num, integer
and fill it with records 1-31 (so it is useful for other reasons, like
getting a specific day of a month)
then, in the RecordSource for Invoice, add the Numbers table (no
relationship line) and put Num on the grid
then, modify strWhere to this:
strWhere = "OrderNr=" & Me!OrderNr & " AND Num=2"
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.accessmvp.com/Strive4Peace/Index.htm
*
(: have an awesome day :)
*
> Hi!
>
[quoted text clipped - 10 lines]
> This procedure prints only 1 copy instead of 2. How I should change code to
> get 2 copies?
fredg - 30 Apr 2008 20:28 GMT
> Hi!
>
[quoted text clipped - 10 lines]
> This procedure prints only 1 copy instead of 2. How I should change code to
> get 2 copies?
You can't simply throw a number out(2) and expect Access to know what
to do with it.
The syntax for the OpenReport method is shown in VBA help files. It
does not include an argument to print out x number of copies.
Look up the SelectObject and and the PrintOut methods in VBA help.
Try...
Private Sub PrintInv()
Dim strDocName As String
Dim strWhere As String
strDocName = "Invoice"
strWhere = "OrderNr=" & Me!OrderNr
DoCmd.OpenReport strDocName, acViewPreview , , strWhere
DoCmd.SelectObject acReport, strDocName, False
DoCmd.PrintOut acPrintAll , , , , 2
End Sub

Signature
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Daniel Pineault - 30 Apr 2008 20:30 GMT
Check out
http://www.databasedev.co.uk/print_multiple_copies.html

Signature
Hope this helps,
Daniel Pineault
For Access Tips and Examples: http://www.cardaconsultants.com/en/msaccess.php
If this post was helpful, please rate it by using the vote buttons.
> Hi!
>
[quoted text clipped - 10 lines]
> This procedure prints only 1 copy instead of 2. How I should change code to
> get 2 copies?