Create table with random records

A

Angela

I need to create a table that randomly picks from a list
of numbers and assigns them into a specified layout.

For example, suppose I have a list of 20 distinct
numbers. The user would input the layout that they want.
In this example they could choose 4 by 5 or 10 by 2.

I want to create a table that has the following fields

Replicate Row Column Number

Pull one of the 20 numbers at random and assign it to each
row, and not reuse the number again in a single replicate.
The user would indicate how many replicates to create and
the numbers would be assigned randomly for each replicate.

So if they chose 5 replicates, 4 rows and 5 columns, and
they had a list of 20 numbers in a table, it would create
a new table that looked like:

1 1 1 5934
1 1 2 9742
1 1 3 8733
1 1 4 7508
1 1 5 2275
1 2 1 1535
1 2 2 1789
1 2 3 5847
1 2 4 9087
1 2 5 2358
1 3 1 3980
....
1 4 5 9291
2 1 1 7508
2 1 2 2275
etc. for 5 replicates.

I found a function at
http://www.mvps.org/access/queries/qry0011.htm that works
nicely to pull the numbers from the table in a randomized
fashion. I cannot figure out how to create the other
columns though.

Angela
 
Top