Results 1 to 2 of 2
  1. #1
    Aleathia is offline Novice
    Windows 8 Access 2013
    Join Date
    Sep 2015
    Posts
    1

    Duplicate Value Error


    I am very new to Microsoft Access (started three hours ago), and I have a problem with my database.For my assignment I need make two tables and fill them with certain information:Click image for larger version. 

Name:	screenshot 1.png 
Views:	9 
Size:	17.9 KB 
ID:	21920Here you can see that until song 9 there is no problem, but when I enter the second album and song 1 it gives me this error:Click image for larger version. 

Name:	screenshot 2.png 
Views:	9 
Size:	17.0 KB 
ID:	21921And for your information in table ALBUM ALBUM_no is primary key and in Tracks Tracks_no is primary key.Click image for larger version. 

Name:	screenshot 3.png 
Views:	9 
Size:	14.0 KB 
ID:	21923Click image for larger version. 

Name:	screenshot 4.png 
Views:	9 
Size:	15.5 KB 
ID:	21922Please help me and remember I am kind of a noob still in this.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    If TrackNo is defined as primary key then that means there cannot be duplicate values in that field. There can be only 1 of each track number. That's what primary keys are - unique values.

    Your options are:

    1. don't have a primary key in Tracks - a primary key is only necessary if this table has a related dependent table where the primary key value will be saved as a foreign key

    2. create an Autonumber field in Tracks and define it as the primary key

    3. compound primary key based on Album_No and Track_No - I advise avoiding compound keys

    You need to get a full understanding of what primary and foreign keys are before proceeding.

    Regardless of option chosen, probably should set the Album_No and Track_No fields as compound index to prevent duplicate pairs.
    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. Duplicate Values Error?
    By batowl in forum Forms
    Replies: 8
    Last Post: 10-15-2014, 12:23 PM
  2. duplicate error
    By msasan1367 in forum Access
    Replies: 3
    Last Post: 04-25-2013, 01:11 PM
  3. Replies: 4
    Last Post: 02-13-2012, 08:33 AM
  4. Error on entering duplicate value
    By anwaar in forum Programming
    Replies: 3
    Last Post: 09-02-2011, 01:25 PM
  5. Duplicate Entry Error
    By Dee300 in forum Forms
    Replies: 3
    Last Post: 08-16-2011, 07:29 PM

Tags for this Thread

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