Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / April 2008

Tip: Looking for answers? Try searching our database.

Number of copies

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mark Anders - 30 Apr 2008 17:53 GMT
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?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.