Field type txt or nos for relating to autonumber field ?

S

Steve

Hi,
Should I make the field called ID in my second table a number or text type
of field when that field relates to my first table's primary key field
called ID which is an Autonumber field or does it not matter ?

This second tables PrimaryKey field will be called PhotoID by the way.

Steve
 
J

Jeff Boyce

Steve

An Access Autonumber is a long integer. You'll need to have a "compatible"
data type in your second table (i.e., a Long Integer).

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Steve

Hi Jeff,
I have field type for the field that relates to the primary key of the first
table, as Number and its LongInteger so guess thats ok.
Steve
 
J

Jeff Boyce

If you tried to use "Text" and then told Access to relate the two on those
fields, Access would "choke" and tell you something about a "data type
mismatch".

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
S

Steve

Hi Jeff,
Good to know, my gut instinct is choose type Number for a field to relate to
a PrimaryKey field, as opposed to Text, confirmed by your answers so I
should be ok.

Steve
 

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