J
Jim/Chris
Yes in the debug window type randomize.
In your query
add your name field in the first column
Add Shuffle: RndNum([name]) in the second column
run the query and sort on the Add shuffle field.
You will notice that every time you run this query the
names appear in a different order. If you are running a
drawing you could take the first entry or any entry. The
important thing to remember is every time you run it the
order will be random. Isn't that what you want?
Jim
In your query
add your name field in the first column
Add Shuffle: RndNum([name]) in the second column
run the query and sort on the Add shuffle field.
You will notice that every time you run this query the
names appear in a different order. If you are running a
drawing you could take the first entry or any entry. The
important thing to remember is every time you run it the
order will be random. Isn't that what you want?
Jim
-----Original Message-----
Jim...thanks for the response. I'm afraid that I'm quite
new at this, so I'm not sure what to do next. I got the
query part OK (I think), but I don't know about issuing a
Randomize command. I did the Ctrl+G and got a "Debug"
window...then what? Do I just type in "Randomize"?
Where? Then what? What about the query? Sorry for being
so helpless with this.
Susan.-----Original Message-----
Try this. I got it from Allen Browne
Assuming you have a numeric primary key named (say)
QuestionID, type this
into the Field row of a query:
RandomNum: Rnd([QuestionID])
Sort the query on this field, and your questions will come
up in random
order.
Note that you need to issue a Randomize command once in
your session for
this to work. You can do that when the database opens, or
just go to the
Immediate window (Ctrl+G) and enter:
Randomize
The Rnd() function does not actually do anything with your
primary key, but
unless you pass some value in from the query, Access
doesn't bother calling
the function so you don't get the random values.
Jim
.-----Original Message-----
We have a staff database from which we will be drawing
names for a contest. Is there some way I can get Access
to randomly select from the over 100 names? I'm trying to
avoid having to print out a list, cut out the individual
names, and pick one from a hat!
.