Page 2 of 2 FirstFirst 12
Results 16 to 20 of 20
  1. #16
    njnewuser is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    11
    Hi,


    You guys have been awesome. I think I am starting to get the hang of this....the only thing I can't figure out is how to get rid of the duplicate employees in the Employee tables. They are duped because of the import from the Excel spreadsheet (same employee taking multiples classes) and/or originally I had set the relationships wrong and I thought that was doing it ( I had EmployeeID PK set to Class Schedule ID PK and now I know that was wrong.)
    Is the best way to run a delete query on tblEmployees to deal with this or is there another way?

    http://office.microsoft.com/en-us/ac...010341696.aspx

    Does this look better?


    Click image for larger version. 

Name:	Capture.PNG 
Views:	12 
Size:	41.6 KB 
ID:	15664

  2. #17
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    Is the EmployeeID_PK an autonumber field? Are there already related child records?
    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.

  3. #18
    njnewuser is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2014
    Posts
    11
    Hi. EmployeeID_PK is an autonumber field.

    When I look under "Insert Subdatasheet" it says both EmployeeID_FK under both Link Child Fields and Link Master Fields.

    I tried to change LName, FName under Field Field Properties Indexing to Yes (No Duplicates) thinking that would help (it was previously set to no) but when I tried to save the table I got this message: "The changes you requested to the tables were not successful because they would create duplicate values in the index, primary key or relationship. Change the data in the field or fields that contain duplicate data, remove the index , or redefine the index to permit duplicate entries, and try again."

    Click image for larger version. 

Name:	DuplicatedEmployeeSnapshot.PNG 
Views:	12 
Size:	14.5 KB 
ID:	15713
    Last edited by June7; 04-01-2014 at 12:24 PM.

  4. #19
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,772
    If there are no dependent records, then just delete the duplicate employee records from tblEmployees. How many employees are there?

    Then set Indexing to Yes(No duplicates).

    If there are dependent records (classes?) then this gets a little complicated.
    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.

  5. #20
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Just a thought,
    Do not know your basis for Unique Employee in the table "tblEmployees". If it is just FirstName & LastName, perhaps you should go in for one/more additional field/s, to make it unique.

    Thanks

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Question about Primary Keys
    By Helystra in forum Database Design
    Replies: 3
    Last Post: 11-21-2013, 03:56 PM
  2. Changing primary keys
    By ksammie01 in forum Database Design
    Replies: 4
    Last Post: 02-07-2013, 07:56 PM
  3. How to create two primary keys
    By Shabana123 in forum Database Design
    Replies: 1
    Last Post: 09-08-2012, 05:55 AM
  4. primary/foreign keys
    By st1300 in forum Database Design
    Replies: 38
    Last Post: 12-04-2011, 01:27 PM
  5. Query using the same primary keys.
    By Franuzz in forum Queries
    Replies: 1
    Last Post: 04-11-2011, 11:27 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