473,320 Members | 1,846 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,320 software developers and data experts.

Unique ID's with Code 1- whatever

I have an application that will have a Male and Female, the Date of Birth and
finally a total number of animals. I would like to create a unique ID for each
of the animals using this last number; example

ABC - XYZ - 00/00/2004 - 12 would be the ID for the litter, I want to create
unique ID's for all 12 animals. This is derived from number of Females, number
of Males

Female =ABC - Male=XYZ - Date of Birth=00/00/2004 - Total Females & Males 12
ABC - XYZ - 00/00/2004 - 01
ABC - XYZ - 00/00/2004 - 02
ABC - XYZ - 00/00/2004 - 03
ABC - XYZ - 00/00/2004 - through 12 programatically with code. Any help would
be greatly appreciated.

Michael
Nov 12 '05 #1
1 1326
Lumpierbritches wrote:
I have an application that will have a Male and Female, the Date of Birth and
finally a total number of animals. I would like to create a unique ID for each
of the animals using this last number; example

ABC - XYZ - 00/00/2004 - 12 would be the ID for the litter, I want to create
unique ID's for all 12 animals. This is derived from number of Females, number
of Males

Female =ABC - Male=XYZ - Date of Birth=00/00/2004 - Total Females & Males 12
ABC - XYZ - 00/00/2004 - 01
ABC - XYZ - 00/00/2004 - 02
ABC - XYZ - 00/00/2004 - 03
ABC - XYZ - 00/00/2004 - through 12 programatically with code. Any help would
be greatly appreciated.

Michael


Something like (air code, uses DAO, minor mods needed for ADO, assumed
form textboxes with names [txt...])

Dim strKeyPrefix as String
Dim lngBaby as Long
Dim rst As Recordset
Dim db As Database
strKeyPrefix = [txtMother] & "-" & [txtFather] & "-" & [txtDOB] & "-"
set db=CurrentDb()
set rst = db.OpenRecordset("NameofBabyTable")
with rst
For lngBaby = 1 to [txtNumberOfBabies]
.AddNew
!IDField = strKeyPrefix & Format(lngBaby,"00")
' other fields to suit
.Update
Next
.Close
end with
set rst=nothing
set db=nothing

--
Error reading sig - A)bort R)etry I)nfluence with large hammer
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: mr_burns | last post by:
hi, i am wanting to count the number of unique rows under a certain column. i want to count how many times a page has been accessed. how i plan to do this is every time a page is accessed, a...
6
by: DraguVaso | last post by:
Hi, I once saw a fax-application that puts faxes as email in a pst-file, sends the ID of that email to a user, and than an application opens that specific email/fax on the screen of the user. ...
3
by: Jason | last post by:
I was given a database that has unique IDs for each record such as: AL00001 AL00002 AL00003 etc The trouble is, I'm going to need to import data from another source that will also have IDs...
1
by: Lumpierbritches | last post by:
I have an application that will have a Male and Female, the Date of Birth and finally a total number of animals. I would like to create a unique ID for each of the animals using this last number;...
24
by: pristo | last post by:
hello All, how can i insert unique ID into binary file (that created by compiler)? (so after compiling i can to identify the src that i use) thx
2
by: Benjamin Smith | last post by:
I have two tables like following: create table attendancereport ( id serial unique not null, staff_id integer not null references staff(id), schoolyear varchar not null references...
15
by: A. Farber | last post by:
Hello, I'm programming a web game on OpenBSD, but am also trying to keep in runnable on Linux and Cygwin. I have a list of tables at which a player/kibitzer can sit down or create a new empty...
13
by: gamernaveen | last post by:
I am coding a script , where basically the user has to enter his name , choose file , file comments if required and upload. The file comments , name , filename will be stored in the database with...
4
by: Mystagogue | last post by:
Given XML like this... <stuff> <thing id="1" result="true"/> <thing id="2" result="true"/> <thing id="3" result="false"/> <thing id="4" result="false"/> <thing id="5" result="error"/>...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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...
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)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.