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 / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

Print report multiple times based on value in the report

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
B Garner - 31 Jan 2006 10:36 GMT
Hi all

Help please.

I would like to automate the printing of  a report.
The report actually is a single page and prints a label. I would like to be
able to print the report multiple times based on the value of the items
field.
I have a command button which opens the report in the print option. This
works fine when there is only 1 item.
Ideally if there were 5 items then the report would print 5 times. I seem to
be tying myself in knots trying to do this.

Many thanks in advance.

B Garner
Anthony England - 31 Jan 2006 12:27 GMT
> Hi all
>
[quoted text clipped - 12 lines]
>
> B Garner

There are many solutions to this.  One solution involving no vba coding is
to create a table tblNumber:

Qty    F1
1    1
2    1
2    2
3    1
3    2
3    3
4    1
4    2
4    3
4    4
etc

Then you can base the report on a query which joins tblYourTable.Qty to
tblNumber.Qty so you get the correct number of records.  Although this
approach is simple and reliable you would have to make sure your tblNumber
had sufficient entries - you could do this by entering records for numbers 1
to 50, and putting a validation rule on tblYourTable.Qty to ensure it was
not more than 50.
Lyle Fairfield - 31 Jan 2006 20:02 GMT
Perhaps, you can modify this to do what you want.

' Customers report must have
' HasModule property set to Yes
Sub PrintCustomers(ByVal Printings As Long)
   Dim Customers As Report_Customers
   Set Customers = New Report_Customers
   Customers.Visible = True
   While Printings > 0
       DoCmd.PrintOut
       Printings = Printings - 1
   Wend
   Set Customers = Nothing
End Sub

Sub test()
   PrintCustomers 3
End Sub
 
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.