Results 1 to 9 of 9
  1. #1
    Dida is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    7

    Parent-child relations

    Hi,



    I'm creating a database and I'm having trouble with my relations. It won't let me choose which is the parent or child table. My objective is to have access from a field in the back-end, to another table.


    If you need more details, please let me know.

    Your help is greatly appreciated.

    Thank you.
    Dida

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    do you mean in the DATABASE TOOLS, RELATIONSHIPS?
    or
    in a form, with parent form / sub form?

    if form, create 2 forms, edit 1 (the master) in this drag and drop a subform control onto the form (this will be the child)

  3. #3
    Dida is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    7
    In the database tools, relationships. Where we drag from one field to another to connect the two.

  4. #4
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    Typically the MANY side of a relationship is the 'child' side
    The ONE side of a one to many relationship is the 'parent' side

    You just need to define what type of relationship (one to many, many to many, one to one) your tables have.

  5. #5
    Dida is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    7
    It only allows me to have one to many relationships for some reason.

  6. #6
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you double click the line connecting the two tables you should be able to define the relationship type, or modify it.

    You do not need to use the relationships at all if you don't want to they are there simply (from my point of view) to help create connections when you start building queries, so I haven't messed around with the 'how' of the join but I suspect it's examining your tables to see how your tables are indexed.

    For instance if you have tblTest with two fields T1_PK and TestDesc, and have a second table tblTest2 with three fields, T2_PK, T1_PK, Test2Desc, the field T1_PK (the foreign key to tblTest) would have to be indexed (in the table design) as YES(No Duplicates) for a one to one relationship to be imposed.

  7. #7
    Dida is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    7
    I agree to not being obligated to create relationships until a query is built. However, for my case, I do need the relation because I'm trying to get data from another table that is associated with the first one.

    Ex.
    TblOne
    tblOne_id
    fieldOne
    fieldTwo


    TblTwo
    tblTwo_id
    fieldThree



    I want fieldOne to be linked to tblTwo_id for the purpose of extracting and storing its related data to that record automatically from the back-end (datasheet view).

  8. #8
    JamesDeckert is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jul 2015
    Location
    Salina, KS
    Posts
    262
    Looking at your tables assuming that the id fields are your Primary Keys, you would define them as you stated as one to many which you said earlier is all Access will let you do. What kind of relationship do you want?
    each value in tblTwo_id can only occur once, but this value can occur many times in fieldOne of TblOne. This is one to many.

  9. #9
    Dida is offline Novice
    Windows 8 Access 2013
    Join Date
    Aug 2015
    Posts
    7
    The one to many is fine. The main thing I want to be able to do is to get access through the datasheet view to other tables. Here's an example. I want it to be the same for another table.
    Attached Thumbnails Attached Thumbnails db (2).png  
    Last edited by Dida; 08-19-2015 at 03:42 PM.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 01-21-2014, 11:32 AM
  2. Replies: 3
    Last Post: 07-03-2013, 01:20 PM
  3. Parent Child Relationship
    By Guru86 in forum Database Design
    Replies: 1
    Last Post: 06-20-2013, 10:48 AM
  4. child references to parent
    By GraeagleBill in forum Programming
    Replies: 4
    Last Post: 04-10-2013, 02:25 PM
  5. Child/Parent relationship
    By ErnieS in forum Forms
    Replies: 1
    Last Post: 08-20-2010, 01:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums