Page 4 of 4 FirstFirst 1234
Results 46 to 59 of 59
  1. #46
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31

    Quote Originally Posted by jzwp11 View Post
    tblPartColors is only the destination table, so you want a unique ID to be created for the primary key field. But in using the DISTINCT key word, you should not have more than one incoming record with the same combination of partID and colorID.
    I do though. i will have to look at the code closer to make sure I am not making any mistakes. Maybe there is something wrong with the data I am importing, or the structure of the data.

  2. #47
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Can you post the data?

  3. #48
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Yup, I sure can.
    What data would you like to see? And how should I post it?

  4. #49
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If you have the imported data in a table already in the database, it would be best to post the database and I can see exactly what you have. Of course, you should remove/change any sensitive info. I would run the compact & repair utility on the database and then zip it prior to attaching it. To attach a file, just click on the paperclip icon above where you type your response.

  5. #50
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Ok, Here ya go. The tbl_PartsList_Import already has data in it ready to go.

  6. #51
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    I'll have to take a look at it this evening. I only have Access 2003 here at work.

  7. #52
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Ok, and just so you know, I left out the DISTINCT from qry_PartsList_Import just because I was messing around with it. Forgot to put it back in.

  8. #53
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Ok, So I think I may have figured it out, logically not programatically.
    The query selects distinct records from the tbl_PartsList_Import and puts them into the tblPartColors.

    The problem lies in the query. Every time I run it, it is only select the distinct record in the import table. It does not compare the distinct records to the records already imported into the TblPartColors. Therefore, duplicates can and will happen.

    So, is there anyway to rewrite that query so it looks for dupes in the tbl it is being appended to?
    Last edited by Zanzibarjones; 06-14-2011 at 09:58 AM. Reason: Grammer

  9. #54
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    The problem lies in the query. Every time I run it, it is only select the distinct record in the import table. It does not compare the distinct records to the records already imported into the TblPartColors. Therefore, duplicates can and will happen.
    You can create an index for tblPartColors based on both partID and colorID and make it unique (no duplicates).

    It sounds like you are doing multiple appends from different source data, correct?

  10. #55
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Yes I will have to. The only way to get the parts lists for each set into the tables correctly is to either import each set individually, or to enter each part and color separately via a form.
    I think it will be quicker to do each set individually and just check for dupes as I am appending.

  11. #56
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Setting up the index will weed out any duplicates for you as you do each append.

  12. #57
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Ok cool, working on that now

  13. #58
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    If you have your data in spreadsheets, I would probably create 1 large spreadsheet with all the part/color/set info for all sets (in 1 sheet) then import that sheet into Access, then select the distinct part number/colors and use that for the append rather than doing each set separately.

  14. #59
    Zanzibarjones is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2011
    Posts
    31
    Ok, that is not a bad idea... I will work on that.

Page 4 of 4 FirstFirst 1234
Please reply to this thread with any new information or opinions.

Similar Threads

  1. multiple table setup
    By bond10aa13 in forum Access
    Replies: 6
    Last Post: 01-05-2011, 02:56 PM
  2. Table Setup advice for invoice processing...
    By Delta729 in forum Database Design
    Replies: 1
    Last Post: 11-23-2010, 11:52 AM
  3. Table Setup and Relationships
    By CoachBarker in forum Database Design
    Replies: 5
    Last Post: 08-16-2010, 09:04 AM
  4. Newbie Table Setup
    By debl5 in forum Access
    Replies: 3
    Last Post: 05-15-2009, 07:46 AM
  5. Please help with table setup
    By newhelpplease in forum Access
    Replies: 0
    Last Post: 10-14-2007, 01:15 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