How can I select a random record from a column?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to design a simple table that will produce a random message,
based on five variable columns.

I want each of following fields to be selected randomly from a query, each
time a button is pressed: noun1, superlative, verb, adjective, noun2.

The returned individual message would be:

Your [noun1] is [superlative] than my [verb] [adjective] noun2.

I am happy with concatenations, but cannot for the life of me work out the
random record selection command. Any ideas?
 
Sounds like a way cool homework assignment. High school or College?

If you haven't already, checkout the Rnd() function in the help file. If
each of the words has a unique id, then you can generate a random number
between the highest and lowest WordID values, and have that word selected.
This would need to be done within each category or for each table, or
however you have it setup.

This can probably be done within one or two queries, maybe more, but I would
head the VBA route, unless the teacher as instructed you otherwise. ??
 
Back
Top