setting primary key by using concatenetion

D

Dummy

I would like my primary key to be a combination of the values of 2 fields,
Can I use the concatenation expression?
 
S

Stefan Hoffmann

hi,
I would like my primary key to be a combination of the values of 2 fields,
Can I use the concatenation expression?
Open your table in design view. Mark the two fields. Set the primary key
using the tool bar.


mfG
--> stefan <--
 
D

Douglas J. Steele

Just in case it isn't apparent from Stefan's answer, you're not actually
concatenating the values of the two fields into a single field. You're
creating a Primary Key that consists of the two fields. Note that this will
not work if either of the fields can be Null.

If you need the concatenated value to be shown on forms or reports, create a
query that has a calculated field that concatenates the value, and use the
query wherever you would otherwise have used the table.
 

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