Results 1 to 6 of 6
  1. #1
    smahdih is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    52

    append query without duplicate record

    Dorod (means Hi)



    i create a append query but every time i run this query records duplicate,

    i have a form and a button in form, user type required records in form and then press button, in event click button i have
    docmd.openquer "append query"

    but every time in table create duplicate records

    how fix it?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,746
    Do you have a Primary Key on your Table?
    Show us the table design, and the query SQL

  3. #3
    smahdih is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    52
    Quote Originally Posted by orange View Post
    Do you have a Primary Key on your Table?
    Show us the table design, and the query SQL
    Yes, i have a primary key,

    below code is query sql

    Code:
    INSERT INTO tblKhahSend ( OrderCode, RecieveDate, LeadTime, OrderStatus, Description, KanbanName, QuaOfKanban, OrderDate, SendDate )
    SELECT tblKamRecieve.OrderCode, tblKamRecieve.RecieveDate, tblKamRecieve.LeadTime, tblKamRecieve.OrderStatus, tblKamRecieve.Description, tblKamRecieve.KanbanName, tblKamRecieve.QuaOfKanban, tblKamRecieve.OrderDate, tblKamRecieve.SendDate
    FROM tblKamRecieve;

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,746
    INSERT INTO tblKhahSend
    ( OrderCode, RecieveDate, LeadTime, OrderStatus, Description, KanbanName, QuaOfKanban, OrderDate, SendDate )
    SELECT
    OrderCode, RecieveDate, LeadTime, OrderStatus, Description, KanbanName, QuaOfKanban, OrderDate, SendDate
    FROM tblKamRecieve;
    Your primary key is IdSend which is autonumber. Why do you say you get duplicates?

    Why are your Date field of Text datatype, why not Date/Time datatype?

  5. #5
    smahdih is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    52
    Quote Originally Posted by orange View Post
    Your primary key is IdSend which is autonumber. Why do you say you get duplicates?

    Why are your Date field of Text datatype, why not Date/Time datatype?
    just different idSend, other fields are similar.

    i create a find unmatched query and then append it to tblTable1.

    yes , of course , must be date/time type.

    i do it and worked.

    sepasgozar (tnx alot)

  6. #6
    smahdih is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Posts
    52
    i have a problem, when update a record in main table and run append query,
    tbltable1 not update,
    how fix it?

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

Similar Threads

  1. Replies: 1
    Last Post: 10-06-2011, 08:37 AM
  2. Replies: 7
    Last Post: 07-21-2011, 01:01 PM
  3. Duplicate last record to next record in form
    By jdhaldane in forum Forms
    Replies: 4
    Last Post: 12-17-2010, 04:22 PM
  4. If duplicate record, go to original record
    By BigBear in forum Forms
    Replies: 2
    Last Post: 10-06-2010, 02:58 AM
  5. If duplicate record, go to original record
    By islandboy in forum Access
    Replies: 51
    Last Post: 06-02-2010, 04:17 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