Primary Key Sequential with Letter

fenhow

Registered User.
Local time
Today, 13:49
Joined
Jul 21, 2004
Messages
599
Hi, Looking for a solution.

Table has a relationship with master table.

Joined on TractID primary table - auto number, TractID child table - number.

This works as it should when adding a new record.

What I am trying to do is create a new key for each new record added in the child table with an ID that looks like this:

TractID.A, TractID.B, TractID.C etc. for each new record added in the child table.

Is this possible? if so where do I look, what do I search for or best can someone tell me how to accomplish it?

Many thanks.
Fen
 
New Key? Add a new column? You better provide an example of a few records, before and after, to illustrate what you mean.
 
Fen,
We only know what you tell us about you, your environment and your issue. As spikepl says we need an example or better description too get some context to help us/readers understand.
 
Thanks. It is a two table database. The primary table is Tracts and only one tract per record ie
TractID Acres
1 15

The second table is the owners of the tract so if I had three owners for the tract #1

TractID OwnerID Name
1 1.A Fen
1 1.B Mike
1 1.C Bob

I am trying to auto generate the OwnerID using the TractID and a sequential letter for each new record added.

I hope that helps, if it is easier to use a number ie 1.1, 1.2, 1.3 that may work as well.

Thanks.
Fen
 
I recommend you use atomic data --one fact one field.
If you need tractID and Owner, you can concatenate

FieldToShow: tractID & OwnerId

You could even do tractID & "." & OwnerID
 
Thank you. I don't think I am explaining clearly enough.
If Primary Table has a PK (auto number) ie 1,2,3,4 etc. and my related table has a join to the Primary Table on PK (one to many)

In the related table I want a field that takes the PK1 from Primary Table which is now in the related table (new record) and create 1.A for the first record so the Primary Table looks like this:

PT_ID
1

The Related Table would look like this
PT_ID | RT_ID
1 | 1.a
1 | 1.b

I have uploaded a snapshot of an example of what I am looking for.
Thanks so much.
Fen
 

Attachments

  • Example.JPG
    Example.JPG
    66.8 KB · Views: 117
I must be missing your point.
Let's take an example

tblPeople
PersonID PK
PersonFirstName
PersonLastName
...

tblLand
LandID PK
LandName
LandDescription


tblLandOwners
LandOwnerID PK
PeopleID FK to tblPeople
LandID FK to tblLand

The fields in purple are used together to make a unique composite index to prevent duplicate entries.

Does this make sense in your situation. If not, please put some concrete example together to show exactly what your tables represent.
 

Users who are viewing this thread

Back
Top Bottom