I'm trying to learn how to work with reports.
I have a report and its record source is based on a total query.
This is the sql of the query:
If I filter and open the report by:
everything's fine. No problem at all.
But If I want to filter it using a field that is not listed in GroupBy fields I receive Enter Parameter Value
Now my question:
What's the best practice to open a report and filter it using a field of table that is not in GroupBy list?
Thank you.
I have a report and its record source is based on a total query.
This is the sql of the query:
SQL:
SELECT DISTINCTROW tblParts.Part,
[tblOrders]![Quantity]*[tblparts_Products]![quantity] AS Q,
tblOrders.Quantity,
tblParts_Products.Quantity
FROM (tblParts_Products
INNER JOIN tblParts ON tblParts_Products.PartFK = tblParts.PartPK)
INNER JOIN tblOrders ON tblParts_Products.ProductFK = tblOrders.OrderProductFK
GROUP BY tblParts.Part,
tblOrders.Quantity,
tblParts_Products.Quantity;
If I filter and open the report by:
DoCmd.OpenReport "MyReport",acViewPreview,,"Part='xxx'"
everything's fine. No problem at all.
But If I want to filter it using a field that is not listed in GroupBy fields I receive Enter Parameter Value
DoCmd.OpenReport "MyReport",acViewPreview,,"Barcode='yyy'"
Now my question:
What's the best practice to open a report and filter it using a field of table that is not in GroupBy list?
Thank you.
Attachments
Last edited: