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