One to One relationship

G

Guest

I am developing a database to monitor the expense's of five differnt company
locations which have a ubique 3 digit identifier number. The invoices
genereated from each location have a unique invoice number so that will be
the one to many relationship. The invoices can only have one expense account
per invoice but i am unsure if this should be a one to one relationshsip or
one to many. The tables are:

LOCATION INVOICE ACCTS
LocID= Primary Key InvID =Primary Key AcctID =?

Would it be better to use autonumber for the relationship between ACCTS and
INVOICE?
 
K

Ken Snell \(MVP\)

If each invoice record can have only one account number, then you have a
one-to-one setup for that record. You should be able to use the AcctID value
in the ACCTS field, where AcctID is a foreign key to the primary key in the
Accounts table. No need for another autonumber field here.
 
G

Guest

To be clear on this, the autonumber is the primary key and the AcctId is the
foreign key in the account table?
 
K

Ken Snell \(MVP\)

That certainly is one way of setting up a 1-to-many relationship, yes --
assuming that the autonumber field is the primary key in the "parent" table.
Be sure to set the data type of the AcctID field in the "child" table to
Number - Long Integer.
 

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

Similar Threads

Autonumber 0ne-One 22
relationship inderteminate---Fred? 22
Secondary Key 4
One to one relationship 0
Autonumber in Design 3
One-to-one relationship 2
Primary key to prevent duplicates 8
one to one relationship 5

Top