Results 1 to 6 of 6
  1. #1
    cammyjane10 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    3

    Link two records in the same field using another table

    I'm creating a database for guests at a snowmobile lodge. I would like to create a new Guest in tbGuests but then have the option to create a second new GuestID linked to the first GuestID by a SpouseID. I can't seem to think out how they should be linked. So far I've created a separate table holding the SpouseID as primary key, GuestID and SpouseGuestID. Both the original guest and spouse need their own GuestID's so that I can post charges to each Guest separately if necessary. Then the SpouseID needs to be stored in the tbGuests to reference which guests are linked. Can anyone make sense of my mess?



    Thanks in advance

  2. #2
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    Maybe you're just over thinking it?

    Why not just have a field (SpouseID) in tblGuests to store the PK value of the other guest and when you want to know who's married to who just do a self join?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Why bother? What about other accompanying family members?

    Have a table for all guests (including the primary) and link with ReservationID foreign key field.
    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.

  4. #4
    cammyjane10 is offline Novice
    Windows XP Access 2007
    Join Date
    May 2013
    Posts
    3
    I figured that's what the problem was I was using spouse a little loosely as well. So then would I would create a new reservation using a table with ReservationID(pk) and GuestID. And then if I wanted to add more Guest ID's to that Reservation ID.....I would open a new reservation form but have the ReservationID match the preceding record? My brain just doesn't want to process this for some reason.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Consider:

    tblReservations
    ResID
    ResDate
    ResRoom

    tblGuests
    GuestID
    GuestLast
    GuestFirst
    GuestAddress
    GuestPhone

    tblGuestsRes
    ResID
    GuestID

    If you don't care if a guest has visited previously then could maybe eliminate tblGuestRes and just put the ResID in tblGuests. This means an individual could have prior records but since this is not determined when the reservation is made, there could be inconsistency in data. So Martha Anne Jones could have a record under Martha Jones or Ann Jones or Marta Ann Jones (spelling errors).
    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.

  6. #6
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    Both the original guest and spouse need their own GuestID's so that I can post charges to each Guest separately if necessary.
    Just FYI - Using June7's example above, the field for these charges would go in the junction table (tblGuestRes) if you need to keep them separate for each Guest within a reservation.

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

Similar Threads

  1. Replies: 2
    Last Post: 12-20-2011, 07:33 AM
  2. Link report date with a table field
    By lizzywu in forum Reports
    Replies: 16
    Last Post: 10-27-2011, 09:51 AM
  3. Replies: 1
    Last Post: 07-26-2011, 05:18 PM
  4. Link Records in the Same Table
    By threepwoodjr in forum Database Design
    Replies: 4
    Last Post: 03-17-2011, 06:33 AM
  5. Link ComboBox to field in a table
    By DrDebate in forum Forms
    Replies: 0
    Last Post: 04-27-2007, 08:03 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