473,287 Members | 3,240 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Automatic assignment of next random no. to new record

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
4 2180
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: svilen | last post by:
hello again. i'm now into using python instead of another language(s) for describing structures of data, including names, structure, type-checks, conversions, value-validations, metadata etc....
2
by: Ini | last post by:
Hi, Is there an easy way to pick at random one record out of a recordset and then leave this recordset? I was thinking about doing a recordcount of the recordset, then find at random the...
2
by: anita | last post by:
Hello Can anybody pls help me out. I am creating a table with a field that has about 50,000 randomly generated values(RandomID). Everytime I enter a new record with new RecordID, I want the next...
2
by: Andre | last post by:
I'm trying to write a Password generating program which will fill one of the fields in our Accounts Table with an eight-digit password made up of numerals, upper and lower case letters. I'm...
13
by: Daniel W | last post by:
Hi! I tried to post this to comp.lang.c.moderated but it didn't seem to go through. I've got a question about volatiles in assignment expressions. I found the following code snippet in an...
48
by: Jimmy | last post by:
thanks to everyone that helped, unfortunately the code samples people gave me don't work. here is what i have so far: <% Dim oConn, oRS, randNum Randomize() randNum = (CInt(1000 * Rnd) + 1) *...
0
by: cephal0n | last post by:
Hi All! I have two table tblHome1, contains all the unique PinNo and tblHome2 contains a duplicated PinNo and description. I put an automatic numbering (ProdID) and set it as my index. What I want...
2
by: fran7 | last post by:
Hi, I wonder if anyone could point me in the right direction. I have this script that gets a random record from my database. All records have an id, how do I instead of random just go to the next...
0
by: solargovind | last post by:
Hello, I have few problem with Dlookup condition. I need to retrieve next record or previous record based on certain condition. The conditions are set in in the combo box. Here, I am trying to...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.