Hello all,
I am new at programming with Access 2013. I have been using as a base the Northwind Database. In this database when you make a sales order all the items keep the same OrderID number. And when you invoice all the items are included in the invoice. Now I want to make some items with a discount and ideally be able to print an invoice with the discount column included. I made a button on the form and on the click event I placed the following code:
If Disc > 0 then
DoCmd.OpenReport "ReportDiscount", acViewPreview
Else
DoCmd.OpenReport "Print Invoice",acViewPreview
Also I made two different reports One is ReportDiscount which contains the discount column and the other Invoice.
This works as long as the last item ordered had a discount, but it doesn't work when the last item has no discount even though the order includes items with a discount. Is there a way of programming this so that it recognizes when the order contains discounted items, no matter where they are placed? Thank you for your help