Newbie Question

mikejerez

Registered User.
Local time
Today, 14:57
Joined
Jul 26, 2008
Messages
10
I have a table which holds information about employees. When it comes to some information such as children names or phone numbers there can be more than one value. Instead of having child1, child2, child3....fields in the table I want to create a different table and store this information there. Then I want to be able to input the data to this table from the same form I use for the first table. This is where I run into my problem, How can I create the fields that will be use for the children names? I need more than one field per record but in the children Names table only has 1 field for that data. I am a bit confused and appreciate any help.
 
One way would be a subform in continuous forms view.
 
Your child table needs to have a number of fields:

ChildID primary key
ParentID foreign key link to parent table
ChildData1 whatever you need to store
ChildData2 etcetera

As Paul suggests, you need a form/subform setup with the parent details in the form and the child details in the subform. If you use the subform wizard , Access will synchronise the ParentID PK FK links for you.
 
I did this and it is the answer I am looking for; however, it is not updating the ParentID on the ChildrenInfo Table.

I have the follwing fields in the ChildrenInfo Table
ChildrenID (autonumber) Primary Key
SSN (Text) Foreign Key to Parent table
ChildName (Text)
ChildDOB (Date)
ChildAge (Number)

I am using SSN for the relationship with the Parent Table. When I place the subform on the Main form it lets me input the first record on the subform but when I click on the second record it gives me an error saying "You can not add or change a record because a related record is required in the table 'Parent'."

Then When I look in the Children Info table the data is not updated.
 
It should be working. Can you post a sample of your database?
 

Users who are viewing this thread

Back
Top Bottom