Select a variable number of records in a table.

Ciaran_Enright

New member
Local time
Today, 10:09
Joined
Nov 24, 2005
Messages
8
I’ve done a search and cannot find any similar queries!

I’ve a table that varies in length on each import. I want to divide it by a variable number in say a list or combo box and return the required no of records.

i.e. table length is 120 so divide it by 10 and return the first 12 records or
Table length is 150 /10 it returns the first 15 records.

Basically I’ve a Cycle Count and need to divide the parts to be counted by the number of people available.
 
If this can help you out, here is how to take only part of the records:
Create a query using your table and go to its properties window. You'll see a property called «Top Value». Write «10%» (or whatever you need) instead of «All» and 'Voila'!

Unfortunaltely, you need to give a number or percent of records. You cannot use variables.
 
Last edited:
Thinking about it, if you can use SQL queries in your VBA code, you could use a variable in it...
myQuery= "Select TopValue " & MyVariable & " ..."
You'll need to work a lot with it to pass percent, but if you need more help, just reply and we'll try to help you with it.
 

Users who are viewing this thread

Back
Top Bottom