child link to itself

  • Thread starter Thread starter inungh
  • Start date Start date
I

inungh

I have a child table which has composite key ID and CID which both
link to parent table like following.

I would like to know is it bizard design like this?

tblParent

ID long integer primary key
MyDate Date Time

tblChild

ID long integer primary key
CID long integer primary key
ChildField Text(50)


Data will be

Parent table
ID MyDate
1 01/20/2008
2 03/15/2007
3 04/01/2008

Child table

ID CID ChildField
1 2 First time
1 3 Second time


Your information is great appreciated,
 
Consider doing this:

tblParent
- IDparent, autonumber

tblChild
- CID, autonumber
- IDparent, long, DefaultValue --> null
- CID_, long, DefaultValue --> null

When a table is liked to itself, I like to use its primary key fieldname
with an underscore

When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name

~~~

it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up


Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace

*
(: have an awesome day :)
*
 
Consider doing this:

tblParent
- IDparent, autonumber

tblChild
- CID, autonumber
- IDparent, long, DefaultValue --> null
- CID_, long, DefaultValue --> null

When a table is liked to itself, I like to use its primary key fieldname
with an underscore

When you make the relationship on the relationship diagram, Access will
put another copy of the table on the diagram -- the copy will have a
"_1" on the end of the name

~~~

it was hard to answer your question when you refer to 'parent' and
'child' -- please use the real names of your data so we can give you a
better answer ... I am not really following how you want the
relationships to be set up

Warm Regards,
Crystal

remote programming and training

Access Basics
8-part free tutorial that covers essentials in Accesshttp://www.AccessMVP..com/strive4peace

  *
    (: have an awesome day :)
  *










- Show quoted text -

Thanks for the information,
 
Back
Top