Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Location
    Phoenix, AZ
    Posts
    122

    Unanswered: "Randomize" a list of records

    I have created a database that generates a list of records that then gets distributed to several tables- through make table queries. I need to randimize the master list of records so that the tables get populated with different records each time. Is there a way to 'randimize' the master list through a query or something?

  2. #2
    Join Date
    Oct 2002
    Location
    Leicester - UK
    Posts
    820

    Re: "Randomize" a list of records

    Originally posted by cc3658
    I have created a database that generates a list of records that then gets distributed to several tables- through make table queries. I need to randimize the master list of records so that the tables get populated with different records each time. Is there a way to 'randimize' the master list through a query or something?
    yeap but the answers complaxity depends on if you mind duplicate values

    simplest sol is

    Randomize
    For i = 0 To numberofrecords
    table = rs.Move(int(rnd* number of records))
    Next

    next up is

    Randomize

    for i = 0 to number of records
    temp = int(rnd*number of records))
    table.FindFirst (rs.Move(temp))
    If table.NoMatch Then
    table = rs.Move(int(rnd* number of records))
    Else
    i = i - 1
    End If
    Next

    this isn't the proper code just the basic idea if you want something more like proper code i need more info on the way you want to us it
    Definition of a Beginner, Someone who doesn't know the rules.

    Definition of an Expert, Someone who knows when to ignore the rules.

  3. #3
    Join Date
    Dec 2002
    Location
    Phoenix, AZ
    Posts
    122
    Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •