Results 1 to 2 of 2
  1. #1
    Pav90 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Apr 2013
    Posts
    1

    No unique index found for the referenced field of the primary table

    Hello,

    I am trying a to build a slot booking database in which users will be able to book slots (ranging from 1-30) on a particular day for a specific site (location).

    When trying to build the relationship between slot in tbl_available and slot in tbl_appointment i get the following error "No unique index found for the referenced field of the primary table"



    the same error pops up when trying to build a relationship between site in tbl_available and site in tbl_appointment.

    Can someone please explain to me why this happens?

    I need both relationships to be 1 to many

    thank you for your timeClick image for larger version. 

Name:	2.JPG 
Views:	40 
Size:	128.6 KB 
ID:	11916Click image for larger version. 

Name:	1.JPG 
Views:	42 
Size:	100.3 KB 
ID:	11917

  2. #2
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    It's happening because tbl_appointment includes date in its Primary Key. This means that it's possible to have multiple entries with the same slot and site values in tbl_appointment but not in tbl_available.

    Also, you should stay away from using reserved words like date in your Tables. It can cause confusion and make it difficult to properly reference Table data on Forms, Reports, and in VBA code.

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

Similar Threads

  1. Replies: 3
    Last Post: 09-25-2012, 05:24 PM
  2. Replies: 1
    Last Post: 08-19-2012, 09:55 PM
  3. Replies: 11
    Last Post: 06-13-2012, 08:14 AM
  4. Replies: 8
    Last Post: 03-16-2012, 01:07 PM
  5. Eerror No unique index found
    By newtoAccess in forum Database Design
    Replies: 4
    Last Post: 12-10-2010, 08:30 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