By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,825 Members | 1,103 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,825 IT Pros & Developers. It's quick & easy.

Automatic assignment of next random no. to new record

P: n/a
I had posted this question before, but did not hear from anybody.
Can somebody pls help me out.
I am creating a table with two fields F1, F2 and F2 has about 50,000
randomly generated alphanumeric nos(RandomID)stored in the combobox
control. Everytime I enter a new record in F1, the next available
RandomID should be automatically assigned to the new record entry and
displayed in the respective form control(F2). Can anybody guide me
through pls.
Any help in this regard will be highly appreciated.
Thanks
Anita
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Anita,
Whats wrong with Access' autonumbering set to random instead of increment?
Works for me, should work for you.

"anita" <ta*******@yahoo.com> wrote in message
news:6e**************************@posting.google.c om...
I had posted this question before, but did not hear from anybody.
Can somebody pls help me out.
I am creating a table with two fields F1, F2 and F2 has about 50,000
randomly generated alphanumeric nos(RandomID)stored in the combobox
control. Everytime I enter a new record in F1, the next available
RandomID should be automatically assigned to the new record entry and
displayed in the respective form control(F2). Can anybody guide me
through pls.
Any help in this regard will be highly appreciated.
Thanks
Anita

Nov 13 '05 #2

P: n/a
Alan

Thanks for your suggestion. I was not aware about autonumbering set to
random. However I cannot use this because my random nos. has to be
necessarily alphanumeric values, which has already been generated by a
statistical program.
Pls let me know if you or anybody else have any further suggestions on
this.
Thanks again.
"Alan Webb" <kn*****@hotmail.com> wrote in message news:<c5********************@comcast.com>...
Anita,
Whats wrong with Access' autonumbering set to random instead of increment?
Works for me, should work for you.

"anita" <ta*******@yahoo.com> wrote in message
news:6e**************************@posting.google.c om...
I had posted this question before, but did not hear from anybody.
Can somebody pls help me out.
I am creating a table with two fields F1, F2 and F2 has about 50,000
randomly generated alphanumeric nos(RandomID)stored in the combobox
control. Everytime I enter a new record in F1, the next available
RandomID should be automatically assigned to the new record entry and
displayed in the respective form control(F2). Can anybody guide me
through pls.
Any help in this regard will be highly appreciated.
Thanks
Anita

Nov 13 '05 #3

P: n/a
On 1 Oct 2004 06:34:57 -0700, ta*******@yahoo.com (anita) wrote:
Alan

Thanks for your suggestion. I was not aware about autonumbering set to
random. However I cannot use this because my random nos. has to be
necessarily alphanumeric values, which has already been generated by a
statistical program.
Pls let me know if you or anybody else have any further suggestions on
this.
Thanks again.

Hi
If you already have a table of random numbers and if this has an index
field of increasing integers, you can use an incrementing autonumber
field on you main table and just join between the two tables.
David

Nov 13 '05 #4

P: n/a
Anita,
Now that I know this, then to do what you want will require some coding.
What you want is a function that can be called that returns your random
numbers. If you don't have to sweat supporting this in something
interesting like Hebrew or Chinese, then you can work with the first 256
characters in the ANSI character set. 48 to 57 are the numeric values of
the numbers 1 to 10. Then 65 to 90 is uppercase letters, and 97 to 122 is
lower case letters. The first thing would be to choose a length for your
random number--probably at least 6 characters and maybe as many as 15 (more
characters improves the odds that there is not already a random number like
it). The second thing is to choose a random number from 1 to 3. This will
decide if the current character will be a number, uppercase or lower case
letters. Then have your code pick a number in the appropriate
range--between 65 to 90, or 97 to 122. Do this as many times as you need to
pick all the characters in your random number. Then have your function
return the result.
If all this is greek then reply to the newsgroup and I'll post an example.

"anita" <ta*******@yahoo.com> wrote in message
news:6e**************************@posting.google.c om...
Alan

Thanks for your suggestion. I was not aware about autonumbering set to
random. However I cannot use this because my random nos. has to be
necessarily alphanumeric values, which has already been generated by a
statistical program.
Pls let me know if you or anybody else have any further suggestions on
this.
Thanks again.
"Alan Webb" <kn*****@hotmail.com> wrote in message
news:<c5********************@comcast.com>...
Anita,
Whats wrong with Access' autonumbering set to random instead of
increment?
Works for me, should work for you.

"anita" <ta*******@yahoo.com> wrote in message
news:6e**************************@posting.google.c om...
>I had posted this question before, but did not hear from anybody.
> Can somebody pls help me out.
> I am creating a table with two fields F1, F2 and F2 has about 50,000
> randomly generated alphanumeric nos(RandomID)stored in the combobox
> control. Everytime I enter a new record in F1, the next available
> RandomID should be automatically assigned to the new record entry and
> displayed in the respective form control(F2). Can anybody guide me
> through pls.
> Any help in this regard will be highly appreciated.
> Thanks
> Anita

Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.