
28-Jul-2006, 08:26 AM
|  | Guest | | | | | | | | | | Random Number generation 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! | 
28-Jul-2006, 08:26 AM
|  | Guest | | | | | | | | | | Re: Random Number generation Randomize before you use Rnd().
--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.htmlReference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067Reference:: 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. | 
28-Jul-2006, 08:26 AM
|  | Guest | | | | | | | | | | 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. | 
28-Jul-2006, 08:26 AM
|  | Guest | | | | | | | | | | 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.
>
>
> | 
28-Jul-2006, 08:26 AM
|  | Guest | | | | | | | | | | 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. | 
28-Jul-2006, 08:26 AM
|  | Guest | | | | | | | | | | 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.
>
> | 
28-Jul-2006, 08:27 AM
|  | Guest | | | | | | | | | | 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.htmlReference:: Sikh Philosophy Network http://www.sikhphilosophy.net/showthread.php?t=12067Reference:: 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 | 
28-Jul-2006, 08:27 AM
|  | Guest | | | | | | | | | | Re: Random Number generation 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
>
> | 
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! | (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 | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On | | | | » Gurbani Jukebox | Listen to Gurbani while surfing SPN! | » Active Discussions | | | | | | | ਨਾਮਾ Today 06:37 AM 2 Replies, 51 Views | | | | | | | | | | | | | | | | | | | | | | | » Books You Should Read... | | | |