I am trying to create a report which is filtered via a form. The form allows me to specify a product id from a combo box and when I click OK it show all of the associated orders in my report. This part is working fine but I would like to be able to only show the top five orders for each product using the quantity field as the criteria.
I know you can use Top 5 in a query but can anyone tell me how to do the same when the filter is being applied via a form first?!
Find the query on which your report is based (see the Recordsource property of the report). Open the query-builder in SQL-mode and add
" TOP 5 " after the first word "SELECT". That should do it, even when applying a filter to the report.