Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how rendomize records

Status
Not open for further replies.

ain79

Programmer
Nov 16, 2002
12
0
0
PK
hello
i want to rendomize records stored in a table and then show them in a list box or any thing else any idea.
 
Add a flag to each record, say called selected.

Open a recordset of all data where selected is false.

Get a random number based on the number of records in the recordset. e.g.

Int((MyRecordset.Recordcount - 1) * Rnd + 1)

Move through the recordset that many times, get the data and set the new flag 'selected' to true

Repeat the process until the record count is 0.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top