Results 1 to 5 of 5
  1. #1
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One-to-Many (Access03)

    What issues prevents you from making a One-to-Many relationship? I have primary keys in the main tables, generated as autonumbers. Then I have those primary keys as foreign keys in another table, set to be number.
    For example
    tblTask pkey = TaskID by autonumber

    tblSubTask pkey = SubTaskID by autonumber, fkey = TaskID, set as number. This gives me a one-to-many relationship
    tblAttachment pkey = JoinID by autonumber, fkey = TaskID, set as number. This one gives me a one-to-one relationship

    Thank you.

    Fay

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: One-to-Many (Access03)

    I don't understand your structure well enough to answer the question. What is tblAttachment, how is it used, and what other fields does it contain? Are there other foreign keys in the tblAttachment table? How are you setting the relationships? The key "JoinID" in tblAttachment suggests this is a join table, which would indicate another foreign key, but you didn't provide enough information to be sure.
    Charlotte

  3. #3
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: One-to-Many (Access03)

    I realized I hadn't done one thing yet when I was getting ready to reply to you. I rebuild the tblAttachment table. I was able to make the join this time. Some times mysterys stay mysteries. Thanks. Fay

  4. #4
    4 Star Lounger SteveH's Avatar
    Join Date
    Jan 2001
    Location
    Chelsea, Gtr London, United Kingdom
    Posts
    587
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: One-to-Many (Access03)

    One thing that gets forgotten is to check how the index is set on the foreign key field (particularly as it is at the bottom of the table design screen). I have had students set the foreign key to 'no duplicates' which obviously stops it being one-to-many relationship.

    Just a thought.
    Steve H
    IT Lecturer/Access Developer
    O2K SR3/O2010; Win7Pro

  5. #5
    5 Star Lounger
    Join Date
    Jul 2001
    Location
    NJ, USA
    Posts
    617
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: One-to-Many (Access03)

    Yep I figured that out after I had put it aside for the night and looked at it after a night's sleep. Something about not seeing the forest for the trees. Or should I say see the db for the tables? Thanks. Fay

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •