Sign Up |  Live StatsLive Stats    Articles 35,345| Comments 159,790| Members 17,820, Newest waheguruhelpme| Online 240
Home Contact
 (Forgotten?): 
    Sikhism

   
                                                                     Your Banner Here!    

Random Number generation

Our Donation Goal : Why Donate? : Donate Today! : Donate Anonymously (ਗੁਪਤ) : Our Family of Supporters
Goal this month: 400 USD, Received: 35 USD (9%)
Please Donate...
Related Topics...
Thread Thread Starter Forum Replies Last Post
Auto number - number of digits Eleanor of Aquitaine Information Technology 3 28-Jul-2006 08:42 AM
generate random number Kirt84 Information Technology 3 28-Jul-2006 08:42 AM
Random Database Generation Sharkbyte Information Technology 2 28-Jul-2006 08:22 AM
record Number and Customer Number Mohammed Information Technology 2 28-Jul-2006 08:16 AM
Number Field not showing zero's at the end of the number. naiveprogrammer Information Technology 3 12-Nov-2005 22:39 PM


Tags
random, number, generation
Reply Post New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!
  #1 (permalink)  
Old 28-Jul-2006, 08:26 AM
joshroberts's Avatar joshroberts
Guest
 
Posts: n/a
   
   
Random Number generation

  Donate Today!   Email to Friend  Tell a Friend   Show Printable Version  Print   Contact sikhphilosophy.net Administraion for any Suggestions, Ideas, Feedback.  Feedback  

Register to Remove Advertisements
I have a form set up to generate a random ID number for every entry. We
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/information-technology/12067-random-number-generation.html
would like to keep this number random however whenever I exit Access the
random number stream resets at the beginning. Is there any way to keep the
random number stream from resetting? Thanks.

*








 
Do share your immediate thoughts or reactions on this issue? We value your views! Login Now! or Sign Up Today! to share your views with us.. Gurfateh!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 28-Jul-2006, 08:26 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Random Number generation

Randomize before you use Rnd().

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
Reply to group, rather than allenbrowne at mvps dot org.

"joshroberts" wrote in message
news:72DAAE76-9659-408C-B4BE-F1C3E8DFC2B7@microsoft.com...
>I have a form set up to generate a random ID number for every entry. We
> would like to keep this number random however whenever I exit Access the
> random number stream resets at the beginning. Is there any way to keep
> the
> random number stream from resetting? Thanks.



Reply With Quote
  #3 (permalink)  
Old 28-Jul-2006, 08:26 AM
Al Camp's Avatar Al Camp
Guest
 
Posts: n/a
   
   
Re: Random Number generation

Josh,
Check out the Randomize statement in Help. Run it just before creating the Rnd value.
But... Access provides for a Random Autonumber (rather than Incremental). That might
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
be an easier solution.
--
hth
Al Camp
Candia Computer Consulting - Candia NH
http://home.comcast.net/~cccsolutions

"joshroberts" wrote in message
news:72DAAE76-9659-408C-B4BE-F1C3E8DFC2B7@microsoft.com...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>I have a form set up to generate a random ID number for every entry. We
> would like to keep this number random however whenever I exit Access the
> random number stream resets at the beginning. Is there any way to keep the
> random number stream from resetting? Thanks.



Reply With Quote
  #4 (permalink)  
Old 28-Jul-2006, 08:26 AM
joshroberts's Avatar joshroberts
Guest
 
Posts: n/a
   
   
Re: Random Number generation

I thought of that and it certainly is a possibility but since this is my
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
primary key I'm still worried about duplicates at some point. Is there any
other way to do this aside from making my random number huge to reduce the
chance of duplicates?

"Allen Browne" wrote:

> Randomize before you use Rnd().
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>
> "joshroberts" wrote in message
> news:72DAAE76-9659-408C-B4BE-F1C3E8DFC2B7@microsoft.com...
> >I have a form set up to generate a random ID number for every entry. We
> > would like to keep this number random however whenever I exit Access the
> > random number stream resets at the beginning. Is there any way to keep
> > the
> > random number stream from resetting? Thanks.

>
>
>

Reply With Quote
  #5 (permalink)  
Old 28-Jul-2006, 08:26 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Random Number generation

You do need to Randomize.

Dupes are possible, so I imagine what you would do is to use values in the
full range of a Long Integer, and test if the number exists before trying to
assign the new record.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"joshroberts" wrote in message
news:78BF5FCF-6A54-4A87-BA11-71057DF75157@microsoft.com...
>I thought of that and it certainly is a possibility but since this is my
> primary key I'm still worried about duplicates at some point. Is there
> any
> other way to do this aside from making my random number huge to reduce the
> chance of duplicates?
>
> "Allen Browne" wrote:
>
>> Randomize before you use Rnd().
>>
>> "joshroberts" wrote in message
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>> news:72DAAE76-9659-408C-B4BE-F1C3E8DFC2B7@microsoft.com...
>> >I have a form set up to generate a random ID number for every entry. We
>> > would like to keep this number random however whenever I exit Access
>> > the
>> > random number stream resets at the beginning. Is there any way to keep
>> > the
>> > random number stream from resetting? Thanks.



Reply With Quote
  #6 (permalink)  
Old 28-Jul-2006, 08:26 AM
jean-pierre.vasseur's Avatar jean-pierre.vasseur
Guest
 
Posts: n/a
   
   
Re: Random Number generation


"joshroberts" a écrit dans le message de news: 72DAAE76-9659-408C-B4BE-F1C3E8DFC2B7@microsoft.com...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>I have a form set up to generate a random ID number for every entry. We
> would like to keep this number random however whenever I exit Access the
> random number stream resets at the beginning. Is there any way to keep the
> random number stream from resetting? Thanks.

Reply With Quote
  #7 (permalink)  
Old 28-Jul-2006, 08:26 AM
Al Camp's Avatar Al Camp
Guest
 
Posts: n/a
   
   
Re: Random Number generation

Allen,
I've never used Random Autonumber. Is there a possibility of dupes with that method?
Thanks,
Al Camp

"Allen Browne" wrote in message
news:OoZIciSmGHA.4268@TK2MSFTNGP05.phx.gbl...
> You do need to Randomize.
>
> Dupes are possible, so I imagine what you would do is to use values in the full range of
> a Long Integer, and test if the number exists before trying to assign the new record.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "joshroberts" wrote in message
> news:78BF5FCF-6A54-4A87-BA11-71057DF75157@microsoft.com...
>>I thought of that and it certainly is a possibility but since this is my
>> primary key I'm still worried about duplicates at some point. Is there any
>> other way to do this aside from making my random number huge to reduce the
>> chance of duplicates?
>>
>> "Allen Browne" wrote:
>>
>>> Randomize before you use Rnd().
>>>
>>> "joshroberts" wrote in message
>>> news:72DAAE76-9659-408C-B4BE-F1C3E8DFC2B7@microsoft.com...
>>> >I have a form set up to generate a random ID number for every entry. We
>>> > would like to keep this number random however whenever I exit Access the
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>>> > random number stream resets at the beginning. Is there any way to keep
>>> > the
>>> > random number stream from resetting? Thanks.

>
>



Reply With Quote
  #8 (permalink)  
Old 28-Jul-2006, 08:27 AM
Allen Browne's Avatar Allen Browne
Guest
 
Posts: n/a
   
   
Re: Random Number generation

Access should not give you dupes, but that feature is really designed for
use with GUIDs (Globally Unique IDentifiers, called Replication ID.)

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
Reply to group, rather than allenbrowne at mvps dot org.

"Al Camp" wrote in message
news:udKrQ0emGHA.2204@TK2MSFTNGP03.phx.gbl...
> Allen,
> I've never used Random Autonumber. Is there a possibility of dupes with
> that method?
> Thanks,
> Al Camp



Reply With Quote
  #9 (permalink)  
Old 28-Jul-2006, 08:27 AM
Al Camp's Avatar Al Camp
Guest
 
Posts: n/a
   
   
Re: Random Number generation

  Donate Today!  
OK Allen. Thanks for that info.
Al Camp

"Allen Browne" wrote in message
news:OeSZQufmGHA.4212@TK2MSFTNGP03.phx.gbl...
> Access should not give you dupes, but that feature is really designed for use with GUIDs
> (Globally Unique IDentifiers, called Replication ID.)
>
> --
> Allen Browne - Microsoft MVP. Perth, Western Australia.
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
> Tips for Access users - http://allenbrowne.com/tips.html
> Reply to group, rather than allenbrowne at mvps dot org.
>
> "Al Camp" wrote in message
> news:udKrQ0emGHA.2204@TK2MSFTNGP03.phx.gbl...
Reference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067
>> Allen,
>> I've never used Random Autonumber. Is there a possibility of dupes with that method?
>> Thanks,
>> Al Camp

>
>



Reply With Quote
   Click Here to Donate Now!

Support Us!
Become a Promoter!
Gurfateh ji, you can become a SPN Promoter by Donating as little as $10 each month. With limited resources & high operational costs, your donations make it possible for us to deliver a quality website and spread the teachings of the Sri Guru Granth Sahib Ji, to serve & uplift humanity. Every contribution counts. Donate Generously. Gurfateh!
ReplyPost New Topic In This Forum Stay Connected to Sikhism, Click Here to Register Now!

Bookmarks


(View-All Members who have read this thread : 0
There are no names to display.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Tools Search
Search:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On

» Gurbani Jukebox
Listen to Gurbani while surfing SPN!
» Active Discussions
sikhism Who is "Mohan"?
Today 08:46 AM
22 Replies, 331 Views
sikhism How important is Matha...
Today 08:12 AM
59 Replies, 1,037 Views
sikhism need urgent advice.......
Today 06:46 AM
6 Replies, 78 Views
sikhism ਨਾਮਾ
Today 06:37 AM
2 Replies, 51 Views
sikhism Sikh Diamonds Video...
Today 04:23 AM
6 Replies, 115 Views
sikhism Are Creator and Creation...
Today 01:30 AM
44 Replies, 2,835 Views
sikhism Herman Hesse,...
Today 00:54 AM
13 Replies, 228 Views
sikhism On a Scale of Most...
Yesterday 21:42 PM
30 Replies, 1,277 Views
sikhism I became victim by...
Yesterday 19:50 PM
0 Replies, 43 Views
sikhism Sikh Books downloads
Yesterday 15:39 PM
2 Replies, 65 Views
sikhism Salok Sheikh Farid ji...
Yesterday 09:35 AM
0 Replies, 46 Views
sikhism In Punjab, three farmers...
Yesterday 05:36 AM
0 Replies, 48 Views
sikhism Supernatural Sikhs, what...
Yesterday 03:45 AM
19 Replies, 413 Views
sikhism Sukhmani Sahib Astpadi...
26-May-2012 22:57 PM
0 Replies, 49 Views
Do You Think You Are...
26-May-2012 09:59 AM
94 Replies, 8,258 Views
» Books You Should Read...
Powered by vBadvanced CMPS v3.2.2

All times are GMT +6.5. The time now is 08:50 AM.
Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.5.2 Copyright © 2004-12, All Rights Reserved. Sikh Philosophy Network


Page generated in 0.42600 seconds with 30 queries