Hi,
I need a suggestion as to which method will be most efficient way of accomplishing this task. I need to build invoice report with Garment Sizes and Quantity. There are seperate records for different sizes with their corresponding quantity in the shipment table. I have to display this information in Invoice Report in a single row with quntities under size lables ( S, M, L, XL, XXL ). Access doesnt allow grouping on multiple fields so i have to stick to programming. I was thinking of the following two methods
a. I come up with a nested SQL which does the job.
b. Before the report is displayed i go through the record set and edit the recordset to get all the sizes and quantity in one row.
c. WILDER APPROACH!! I change the query which i have posted below to exempt size and quantity information so there will be only record for Garment, Style and Colour combination and then run query for each combination for every size and their relevant quantity and then either place those values in the record set and displaying the edited record set or manually setting those values on the report. TBH i havent really thought about displaying at the moments as i havent gone through the calculating part.
But before i go down any of these approaches i want to find out if it is possible to
1. Somehow group three fields in a query
2. Which event is triggered when the report is opened just before its displayed and on form navigation
Or if some one has more experience with Access Reports as i dont have any and they can inform me of a way that i dont have to go through all this.
I need a suggestion as to which method will be most efficient way of accomplishing this task. I need to build invoice report with Garment Sizes and Quantity. There are seperate records for different sizes with their corresponding quantity in the shipment table. I have to display this information in Invoice Report in a single row with quntities under size lables ( S, M, L, XL, XXL ). Access doesnt allow grouping on multiple fields so i have to stick to programming. I was thinking of the following two methods
a. I come up with a nested SQL which does the job.
b. Before the report is displayed i go through the record set and edit the recordset to get all the sizes and quantity in one row.
c. WILDER APPROACH!! I change the query which i have posted below to exempt size and quantity information so there will be only record for Garment, Style and Colour combination and then run query for each combination for every size and their relevant quantity and then either place those values in the record set and displaying the edited record set or manually setting those values on the report. TBH i havent really thought about displaying at the moments as i havent gone through the calculating part.
But before i go down any of these approaches i want to find out if it is possible to
1. Somehow group three fields in a query
2. Which event is triggered when the report is opened just before its displayed and on form navigation
Or if some one has more experience with Access Reports as i dont have any and they can inform me of a way that i dont have to go through all this.
Code:
SELECT Invoice.InvoiceNumber, Invoice.ShipmentNumber, Shipment.ShipmentDate, Shipment.OrderNumber, ShipmentDetails.GarmentNumber, ShipmentDetails.StyleNumber, ShipmentDetails.SizeID, ShipmentDetails.ColourCode, ShipmentDetails.ShipmentQty, ShipmentDetails.UnitPrice, ShipmentDetails.Discount, ShipmentDetails.Price, StockOrder.StockOrderNumber, Customer.CustomerFullName, Customer.CustomerCompanyName, Customer.CustomerInvoiceAddress, Customer.CustomerInvoiceCity, Customer.CustomerInvoicePostcode, Customer.CustomerShippingAddress, Customer.CustomerShippingCity, Customer.CustomerShippingPostcode FROM (Customer INNER JOIN StockOrder ON Customer.CustomerNumber = StockOrder.CustomerNumber) INNER JOIN ((Shipment INNER JOIN Invoice ON Shipment.ShipmentNumber = Invoice.ShipmentNumber) INNER JOIN ShipmentDetails ON Shipment.ShipmentNumber = ShipmentDetails.ShipmentNumber) ON StockOrder.StockOrderNumber = Shipment.OrderNumber ORDER BY ShipmentDetails.GarmentNumber, ShipmentDetails.StyleNumber, ShipmentDetails.ColourCode;
Comment