Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Mar 2003
    Location
    Toronto, Canada
    Posts
    101
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Random Number (Xp/2003)

    Hi Everyone, I have a quick question.
    I would like to have a random number with no duplicates, really an auto number. However, I can seem to have two auto number in one table and I need the two of them in the table. I saw a random function but it seems to only give me 1 or 2 and not anything else. Am I doing something wrong? Or is there a better way around this?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Random Number (Xp/2003)

    Do you really need to store the random number in the table itself? Perhaps someone could help if you explained what you want to accomplish.

  3. #3
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Random Number (Xp/2003)

    An autonumber is intended to be used as a primary key, nothing else. Since you don't need two primary keys, I don't understand why you would need two autonumbers. Perhaps you could explain what you're trying to accomplish.
    Charlotte

  4. #4
    Super Moderator
    Join Date
    Aug 2001
    Location
    Evergreen, CO, USA
    Posts
    6,623
    Thanks
    3
    Thanked 60 Times in 60 Posts

    Re: Random Number (Xp/2003)

    Go to the Visual Basic for Applications and look up the Rnd() function - it will tell you how to generate random numbers in any range, and how to set the seeding of the generator so you get numbers that pass all of the statistical tests as long as you use small samples. Of course the next question is how you intend to use the random numbers.
    Wendell

Posting Permissions

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