auto number primary key

S

Souris

I have an auto number field in my table for primary key.
It does not let me to create relationship when I have auto number field.

Should I use long integer instead or I have something wrong?

Your information is great appreicated,
 
J

Jeff Boyce

If you only have one table, there may not be any "relationship".

If you have two tables related one-to-many, you could use the Autonumber
primary key of the "one" side table, and you'd need to add a LongInt field
(in addition to any primary key) in the "many" side table to hold the ID of
that record's "parent" from your first table.

You'd related the Primary key of the "one" table to the foreign key of the
"many" table.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Souris

Thanks for the message,

I have the relationship after I change the data type.

I got conversion error when I import data from other table?
Can I import data in to a table with auto number primary key?

If not then should I change the auto number as long integer then it lost the
auto number functions.

Can you please advuse?

Your information is great appreciated,
 
P

Pat Hartman

I don't know if the import will work but I do know that linking to the old
table and using an append query to copy data from the old table to the new
table does work. You will only have trouble if the primary keys that you
are appending duplicate that of an existing record.
 
S

Souris

Thanks for the message,
It works,



Souris said:
Thanks for the message,

I have the relationship after I change the data type.

I got conversion error when I import data from other table?
Can I import data in to a table with auto number primary key?

If not then should I change the auto number as long integer then it lost the
auto number functions.

Can you please advuse?

Your information is great appreciated,
 

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