Print All/Selected

L

LesG

I have a form that list Invoices to be printed. On the form I have 2 buttons
'Print All' and 'Print Selected' with an option box to print either to window
or printer:

Private Sub CmdPrintAll_Click()
Select Case Me.optPrint
Case 1
DoCmd.OpenReport "rptInvoice_printQueue", acViewPreview, , ,
acWindowNormal
Case 2
DoCmd.OpenReport "rptInvoice_printQueue", acViewNormal, , , acWindowNormal
End Select
End Sub

Behind the report it has the following query:

SELECT orders.orderID, orders.invoice, orders.printed, orders.CustID,
customers.custref, orders.invoice, orders.df1, orders.reqdate,
orders.CustName, orders.Address1, orders.Address2, orders.Address3,
orders.Postcode, orders.deliveryID
FROM orders INNER JOIN customers ON orders.CustID = customers.CustID
WHERE (((orders.invoice) Like
[Forms]![frmPrintQueue2]![frmInvoicetoPrint].[Form]![invoice] & "*") AND
((orders.printed)=True));


The rptInvoice_PrintQueue, is made up of a main report with a subreport for
the invoice line items

The problem I have is, If I select one invoice, it works fine, however, if I
try to print all it prints each invoice with all the line items for each
customer.

Can anyone help with this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top