Limiting records that appear in a group (1 Viewer)

rzkl

Registered User.
Local time
Yesterday, 23:08
Joined
Nov 22, 2004
Messages
16
I have what I would have thought would be a very simple task to solve and I just can't figure it out. I have a table of inventory records. I want to do a query to limit the output to just 15 records per item. The fields in the table are

ItemNumber PalletNumber

This table has ten to twenty different Item numbers and could be up to hundreds of pallets of each one. I am trying to create a query to group by item number and then only show me the top 15 records for each item number. When I say the top 15 records that would be determined by the pallet number as they are all in numaric order.
I have search through the form and either I not searching for the right words or the answer is just not out here.

I am not very familier with VB, it would be great if there was a solution that I could do in the query build grid.


Thanks in advance for any help.
 

rzkl

Registered User.
Local time
Yesterday, 23:08
Joined
Nov 22, 2004
Messages
16
Thanks, the code worked.
It took almost 15 minutes for the query to run, Im not sure why but the query only had less then 300 records to sort through.
 

pbaldy

Wino Moderator
Staff member
Local time
Yesterday, 23:08
Joined
Aug 30, 2003
Messages
36,118
That's a long time. I use method one on a table with well over 100,000 records. Though it is on SQL Server, it returns records instantaneously. It's a component of a report the users run all day long. They would scream at me if it took 15 seconds, no less 15 minutes. Are you pulling records over a network that might be problematic, or something like that?
 

MSAccessRookie

AWF VIP
Local time
Today, 02:08
Joined
May 2, 2008
Messages
3,428
Thanks, the code worked.
It took almost 15 minutes for the query to run, Im not sure why but the query only had less then 300 records to sort through.

Au usual, pbaldy provided excellent sample code that you needed to tailor to fit your needs. Would it be possible for you to show us the code that you have implemented so that we can see if there are ways we can help you to make it more efficient?
 

Users who are viewing this thread

Top Bottom