Results 1 to 7 of 7
  1. #1
    Cazca is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    28

    One-to-Many not working...

    this is probably an easy easy fix, but i just can't seem to figure it out.

    the goal is to have subdatasheets, but I can't get the one-to-many to work form TblCONTRACT to TblCLIN




    Click image for larger version. 

Name:	DBrela.PNG 
Views:	13 
Size:	12.0 KB 
ID:	22935

    There should be one(contract/task order) to many (CLINs) and one (CLINs) to many (FTEs)

    Can anyone help?

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Quote Originally Posted by Cazca View Post
    ...I can't get the one-to-many to work form TblCONTRACT to TblCLIN...
    You have a One to One relationship defined.

  3. #3
    Cazca is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    28
    shouldn't it automatically define a one to many. This is what it did for me when i set the relationship between CLIN and FTE tables.

    can u manually change this?

    thanks for the quick reply, btw

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    I think the issue is that you have a conflict with CLIN and FTE. If you already defined a one to many with that, the other would have to be one to one. Maybe what you are in need of is another table, a junction table to provide a many to many option in there somewhere.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Linking two tables on primary key (PK) fields will result in a one-to-one relationship.

    A one-to-many relationship is linking the PK field in one table to a foreign key (FK) field in a different table.
    The PK field must have unique values. The FK field must be the same data type and not a PK field.

    While you can have text type fields as PK fields, it is usually better to have Long Integer type fields as PK fields.
    See:
    Microsoft Access Tables: Primary Key Tips and Techniques
    http://www.fmsinc.com/free/newtips/primarykey.asp



    Also, you should not use spaces, special characters or punctuation in object names. Only letters, numbers or the underscore.

  6. #6
    Cazca is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Nov 2015
    Posts
    28
    Thanks ItsMe. I was able to get it to work... the issue was linking two tables on one PK like you mentioned.

    I'll remove the spaces as well. Thanks for the help!

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 8 Access 2013
    Join Date
    Aug 2013
    Posts
    7,862
    Glad to hear.

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

Similar Threads

  1. Working query stops working after importing
    By Abacus1234 in forum Import/Export Data
    Replies: 3
    Last Post: 10-25-2015, 09:12 PM
  2. Replies: 13
    Last Post: 01-22-2015, 05:27 PM
  3. Replies: 1
    Last Post: 12-27-2014, 12:38 PM
  4. Dsum was working now it is not working
    By ssalem in forum Reports
    Replies: 7
    Last Post: 04-18-2013, 02:57 PM
  5. Replies: 3
    Last Post: 01-29-2013, 04:34 AM

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