halem2
Registered User.
- Local time
- Today, 10:43
- Joined
- Nov 8, 2006
- Messages
- 180
Hi All:
Using Access 203.
I have a form and a subform tied up by the PurchseOrder field. The subform shows the items included in the PO but for any PO with more than ONE item, it shows the record as time times as there are item in the PO.
In other words, if I have one PO with 1 item, it shows one time but if I have 5 items in the PO, it shows it as 5 records all having the same PO.
I solved it using the DISTINCT in the query but it now prevents the addition of new records!?
I remove it and it allows additions but with the problem described above.
This is the Form's query:
SELECT DISTINCT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID, Orders.OrderDate, Orders.PurchaseOrderNumber, Orders.ReceivedDate, Orders.ShippingMethodID, Orders.FreightCharge, Orders.SalesTaxRate, Orders.PaymentReceived, Orders.Comment, Orders.PaymentMethod, [Order Details].[ItemReceived?] FROM Orders INNER JOIN [Order Details] ON Orders.OrderID=[Order Details].OrderID WHERE ((([Order Details].[ItemReceived?])=0)) ORDER BY Orders.OrderDate DESC WITH OWNERACCESS OPTION;
this is the SUBFORM's query:
SELECT qryOrderDetailsAll.ProductID, qryOrderDetailsAll.Quantity, qryOrderDetailsAll.[ItemReceived?], qryOrderDetailsAll.PurchaseOrderNumber FROM qryOrderDetailsAll ORDER BY qryOrderDetailsAll.[ItemReceived?] DESC;
Any ideas where I messed up?
thanks
Using Access 203.
I have a form and a subform tied up by the PurchseOrder field. The subform shows the items included in the PO but for any PO with more than ONE item, it shows the record as time times as there are item in the PO.
In other words, if I have one PO with 1 item, it shows one time but if I have 5 items in the PO, it shows it as 5 records all having the same PO.
I solved it using the DISTINCT in the query but it now prevents the addition of new records!?
I remove it and it allows additions but with the problem described above.
This is the Form's query:
SELECT DISTINCT Orders.OrderID, Orders.CustomerID, Orders.EmployeeID, Orders.OrderDate, Orders.PurchaseOrderNumber, Orders.ReceivedDate, Orders.ShippingMethodID, Orders.FreightCharge, Orders.SalesTaxRate, Orders.PaymentReceived, Orders.Comment, Orders.PaymentMethod, [Order Details].[ItemReceived?] FROM Orders INNER JOIN [Order Details] ON Orders.OrderID=[Order Details].OrderID WHERE ((([Order Details].[ItemReceived?])=0)) ORDER BY Orders.OrderDate DESC WITH OWNERACCESS OPTION;
this is the SUBFORM's query:
SELECT qryOrderDetailsAll.ProductID, qryOrderDetailsAll.Quantity, qryOrderDetailsAll.[ItemReceived?], qryOrderDetailsAll.PurchaseOrderNumber FROM qryOrderDetailsAll ORDER BY qryOrderDetailsAll.[ItemReceived?] DESC;
Any ideas where I messed up?
thanks