primary key from 2 diff tables

N

newbietoo

Hi,

is it possible to create a key based on 2 fields from 2 different tables? I
have a year field (child table) and a clientID field (parent table) that
creates a unique record. I would like to display an "already exist" message
and pull up the record.

Thank you!
-Lynn
 
T

Tim Ferguson

is it possible to create a key based on 2 fields from 2 different
tables?

This is normal practice for junction tables implementing M:N relationships.
I have a year field (child table) and a clientID field
(parent table) that creates a unique record. I would like to display
an "already exist" message and pull up the record.

I think this means something different though. This sounds more like a job
for a query. It might be possible to give you a more sensible answer if you
are able to post more details of your actual situation.

Hope that helps


Tim F
 
J

John Vinson

Hi,

is it possible to create a key based on 2 fields from 2 different tables? I
have a year field (child table) and a clientID field (parent table) that
creates a unique record. I would like to display an "already exist" message
and pull up the record.

Thank you!
-Lynn

The Primary Key of the child table could consist of the two fields
ClientID and Yearfield (which should not be named Year, that's a
reserved word). A PK can consist of up to ten fields, it needn't be
just one.

John W. Vinson[MVP]
 

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