Multiple Primary Keys

S

Sondra

I have never worked with multiple Primary Keys in a table
before and now that I've tried it, I'm not sure I've done
it right.

I have a table that identifies the following fields:

TranSheetNumber{PK}
TranSheetVersion {PK}
TranSheetTitle
TranSheetDate

I have then created a form for users to enter the
information into. There is the opportunity to have the
TranSheetNumber be duplicate, but never a combination of
the TransSheetNumber and TransSheetVersion.

TranSheetNumber = 1792
TranSheetVersion = 1.0

TranSheetNumber = 1792
TranSheetVersion = 1.1

However, users are able to enter the same TranSheetNumber
and TranSheetVersion.

Can someone advise me?

Thanks
 
G

Guest

In the table design you should be able to see the two fields that comprise
the primary key identified by a key symbol next to each of their names. If
this is what you see then the primary key is correctly identified. The user
may be able to enter duplications on the form but Access will not allow the
duplicate combination to be saved.
 
S

Sondra

My primary keys are set up right. I know this. But as a
user they are still able to enter the data and when they
attempt to go to the next record they don't get an error
message saying the record could not be written, saved, etc.

Please advise.
 
G

Guest

Is there actually duplicate primary key data in the table?

Look at the table in design view and verify that the primary key is
identified by both fields in the index and that the key is "Unique"
 
B

Brendan Reynolds

What are the data types of the two fields that make up the primary key,
TranSheetNumber and TranSheetVersion?

--
Brendan Reynolds (MVP)
http://brenreyn.blogspot.com

The spammers and script-kiddies have succeeded in making it impossible for
me to use a real e-mail address in public newsgroups. E-mail replies to
this post will be deleted without being read. Any e-mail claiming to be
from brenreyn at indigo dot ie that is not digitally signed by me with a
GlobalSign digital certificate is a forgery and should be deleted without
being read. Follow-up questions should in general be posted to the
newsgroup, but if you have a good reason to send me e-mail, you'll find
a useable e-mail address at the URL above.
 
G

Guest

TranSheetNumber = Number
TranSheetVersion = Text

I looked at the information in Design view and it showed
Index set to No for the TranSheetVersion. I changed it
to Yes(Duplicates OK) and it works great

Thanks for all your help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top