Connect two tables, and insert data at same time

M

Mario Ferreira

I have creating a database with 3 tables:
Client Table

Cli_ID
Cli_Name
Cli_Address
Cli_Postcode
Cli_Age
Cli_Phone
Cli_Email

and a Family Table

Fam_ID
Fam_Father Name
Fam_Mother name
Fam_Father Address
Fam_Mother Address
Fam_Father Contact
Fam_Mother Contact
Fam_Father Postcode
Fam_Mother Postcode

and a Postcode table

Postc_ID
Postc_Zipcode
Postc_Location

How do i connect both table to insert data in one only form? I use a combo
box to select the postcode in both table (client and family)
 
J

John W. Vinson

I have creating a database with 3 tables:
Client Table

Cli_ID
Cli_Name
Cli_Address
Cli_Postcode
Cli_Age
Cli_Phone
Cli_Email

and a Family Table

Fam_ID
Fam_Father Name
Fam_Mother name
Fam_Father Address
Fam_Mother Address
Fam_Father Contact
Fam_Mother Contact
Fam_Father Postcode
Fam_Mother Postcode

and a Postcode table

Postc_ID
Postc_Zipcode
Postc_Location

How do i connect both table to insert data in one only form? I use a combo
box to select the postcode in both table (client and family)

You don't appear to have any links between these tables. If you have a
particular Client record, how do you intend to link that to a particular
Family record? Might there not be two clients in the same family? Might there
not also be more "parents" - step-parents, guardians, etc.?

John W. Vinson [MVP]
 
M

Mario Ferreira

Witch fiels i have to link?

The fiels ID, must be autonumber or only number and if only number how do i
check if that number is already in use.


"John W. Vinson" escreveu:
 
J

John W. Vinson

Witch fiels i have to link?

I have no idea, because I don't know what YOU intend. How do you want the
client and family records to be linked? What is the real-world relationship?

I'd actually suggest *one* table of People containing clients and family
members. You could have a Yes/No field indicating that this person is a
client. There'd be a second Relationships table with fields PersonID,
RelatedPersonID, and Relationship so you could have any number of family
members related to a client, or multiple clients related to a parent.
The fiels ID, must be autonumber or only number and if only number how do i
check if that number is already in use.

I'm sorry, this question doesn't seem to make sense to me. You cannot link an
Autonumber to another Autonumber, but you should never need to do so. An
Autonumber primary key can be linked to a Long Integer foreign key.

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