Results 1 to 3 of 3

Thread: Random??

  1. #1
    Join Date
    Oct 2001
    Location
    Bay Area, CA
    Posts
    117

    Unanswered: Random??

    I generate a 'default' number in a table as follows:
    "T" & Right("000000" & CDbl((100000*Rnd())),6)

    The result is a random number starting with a T and it has 6 numbers.

    How come that I get the same number sequence every time I open the database? Does the random number generator follow a same pattern?

  2. #2
    Join Date
    Nov 2001
    Posts
    336
    Hi,

    MS Access help says:

    Before calling Rnd, use the Randomize statement without an argument to initialize the random-number generator with a seed based on the system timer.

    HTH

  3. #3
    Join Date
    Oct 2001
    Location
    Bay Area, CA
    Posts
    117
    Thanks, and I am using that to reset the seed in code, but I am using the Rnd function to create a default value in a back-end table. This makes things more complicated.

Posting Permissions

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