random numbers

T

tiredoftrying

I have a table with several columns, one of which is a number column and
contains the numbers 1 thru 24 - the table has 24 records and thats all it
will ever have. I have one form which is un-bound and i would like to keep it
that way - I want to have a command button on the form which will randomly
replace the numbers - kind of re-shuffle the numbers, there can be no
duplicates.
 
J

John Vinson

I have a table with several columns, one of which is a number column and
contains the numbers 1 thru 24 - the table has 24 records and thats all it
will ever have. I have one form which is un-bound and i would like to keep it
that way - I want to have a command button on the form which will randomly
replace the numbers - kind of re-shuffle the numbers, there can be no
duplicates.

Rather than *replacing* the numbers (updating your table), would it
suffice to present the records (on a Form or Report) in random order?
If so, just create a query

SELECT <whatever fields you want to see>
FROM yourtable
ORDER BY Rnd([ThisFieldName]);


John W. Vinson[MVP]
 
T

tiredoftrying

no I actually need to replace them

John Vinson said:
I have a table with several columns, one of which is a number column and
contains the numbers 1 thru 24 - the table has 24 records and thats all it
will ever have. I have one form which is un-bound and i would like to keep it
that way - I want to have a command button on the form which will randomly
replace the numbers - kind of re-shuffle the numbers, there can be no
duplicates.

Rather than *replacing* the numbers (updating your table), would it
suffice to present the records (on a Form or Report) in random order?
If so, just create a query

SELECT <whatever fields you want to see>
FROM yourtable
ORDER BY Rnd([ThisFieldName]);


John W. Vinson[MVP]
 
Top