Randomizing table records (1 Viewer)

l0is

New member
Local time
Today, 05:59
Joined
Feb 9, 2008
Messages
2
Hi. This is my first post.
I just recently started using MS Access.

I have a table with 40 records, and would like them to change their order in a random way, every time the database is opened.

Is there a way to do this?
Maybe with a macro or module in autoexec?

Thanks in advance.
LF
 

ajetrumpet

Banned
Local time
Yesterday, 23:59
Joined
Jun 22, 2007
Messages
5,638
Hi. This is my first post.
I just recently started using MS Access.

I have a table with 40 records, and would like them to change their order in a random way, every time the database is opened.

Is there a way to do this?
Maybe with a macro or module in autoexec?

Thanks in advance.
LF
You'll have to use a query as a substitute for the table. Look at Wayne's sample in post #31 here. He does just what you're asking.
 

l0is

New member
Local time
Today, 05:59
Joined
Feb 9, 2008
Messages
2
You'll have to use a query as a substitute for the table. Look at Wayne's sample in post #31 here. He does just what you're asking.


Thanks ajetrumpet.
That post is helpful, but too confusing for me:confused:

My ideia was to display that table records in a form (in a different order every time).
Isn't there any other way to randomize one of the columns of the table using code (without using querys)?

Thanks!
LF
 

ajetrumpet

Banned
Local time
Yesterday, 23:59
Joined
Jun 22, 2007
Messages
5,638
My ideia was to display that table records in a form (in a different order every time).
That's a great idea l0is, but unfortunately, it's not very simple.
Isn't there any other way to randomize one of the columns of the table using code (without using querys)?
The simple answer is NO. There are plenty of ways to play the randomizing game with data, but none of them are easy to understand. I would say the easiest way is to use the array as a "pass-through" entity, like I have done here. And that's pretty complicated. Regardless though, there is no easy way to do it.

The simplist way is to use Wayne's method in that other post, but I can't remember if that works for all data types or not... (if it doesn't, than it's no good).
 

Users who are viewing this thread

Top Bottom