Results 1 to 5 of 5
  1. #1
    Modify_inc is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    100

    Can't swap table sides in a one-to-many relationship

    Using Access 2013, what would cause a one-to-many relationship to work ONLY in one direction? Say from Table A to Table B, and when I attempt to change the direction of the relationship, so that is should be Table B to Table A, it doesn’t work. I don’t get an error, but Access reverts any changes I make while in the Relationship Design.

    I have four tables: Renter, Location, Condo, and Agreement.



    RENTER (RENTER_NUM, FIRST_NAME, LAST_NAME, ADDRESS, CITY, STATE, ZIPCODE, TELEPHONE, EMAIL)

    LOCATION (LOCATION_NUM, LOCATION_NAME, ADDRESS, CITY, STATE, ZIPCODE)

    CONDO (UNIT_NUM, LOCATION_NUM, SQR-FT, BDRMS, BATHS, WEEKLY_RATE, RENTER_NUM)

    AGREEMENT (RENTER_NUM, UNIT_NUM, START_DATE, END_DATE, WEEKLY_FEE)

    I can link RENTER to AGREEMENT using the RENTER_NUM field, which enables one renter for multiple agreements. I can link CONDO to AGREEMENT using the UNIT_NUM field, which enables one condo for many agreements, but I need AGREEMENT to be the one side and CONDO the many.

    The problem is Access will lead me to believe I can change the sides, but when I create it after making my selections in the Relationship Design window, it reverts back, and doesn’t even give me an error or a reason why. I closed out of Access and tried it again but same thing.

    Could it be related to the AGREEMENT table using two foreign keys as primary keys? If so, why?

    Mike

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Perhaps, something like this
    Code:
    Renter--->Agreement<----Condo
                              +
                              |
                          Location

  3. #3
    Modify_inc is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    100
    After much trial and error, I believe that will have to work.

    I was trying to design it so a different renter couldn't rent a condo that was already rented by another renter. Currently, a renter can rent a condo even if it has already been rented. I assume this can't be resolved by the table relationships alone.

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    Not unless you work out the appropriate Business Facts

    -A Condo is situated at a specific Location
    -A Renter rents 1 or more Condo
    -An Agreement identifies the Renter, the Condo and the MonthlyRentalFee
    -An Agreement has a StartDate and an EndDate
    -A MonthlyRentalFee is charged to the Renter

    A Renter may consist of 1 or many People

  5. #5
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,622
    Why would one agreement have many condos?

    Preventing a condo from being associated simultaneously with two parties will require other data validation methods - similarly to checking out a book in the Lending Library db template.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 3
    Last Post: 05-11-2015, 12:35 PM
  2. Swap words from a string.
    By tigorin in forum Access
    Replies: 13
    Last Post: 04-07-2014, 02:37 PM
  3. Text Box missing sides when printing
    By ryan.boyle in forum Reports
    Replies: 2
    Last Post: 02-15-2013, 11:08 AM
  4. Replies: 13
    Last Post: 06-05-2012, 10:46 AM
  5. Replies: 2
    Last Post: 04-08-2012, 03:04 PM

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