Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    update query not updating (Access 2000)

    update query not updating

    I want to insert the fields branch1 and itmes1 from the table Products1 into the samed fields in the table Products.I use the following query:
    INSERT INTO products ( Productid, branch1, items1 ) SELECT products1.Productid, products1.branch1, products1.items1 FROM products1;
    I cannot update the query and i receive the message error due to key violations. .I am asked shall i ignrore this message but nevertheless cannot update.How can i change my sql update qyery so that it updates?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: update query not updating (Access 2000)

    This isn't an update query, it's an append query. What exactly are you trying to do? The key violation error suggests that you're trying to append records to ProductIDs that already exist in the target table.
    Charlotte

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Posts
    280
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: update query not updating (Access 2000)

    Dear Charlotte,

    Thank you very much for your reply. I see now my mistake,what i meant is an update query and not an append query. Actually what i want is the following.I am importing the table Products1 into the database where an identical table Products exists. There are two fields in the both tables, branch1 and items1.I want to update all the fields in the present table Product with the data from the same fields of the imported table Products1.The select clause for the table Products is the following:
    SELECT products.Productid, products.branch1, products.items1
    FROM products;
    The select clause of the table Products1 is the following
    SELECT products1.Productid, products1.branch1, products1.items1
    FROM products1;
    if branch1 from table "products1" is 3000, i want to update it so that

    the branch1 in the table "Products" should read 3000 and not 0.
    In short i want all the fields from the Products.Branch to be updated

    with the data from the fields Products.Branch1


    Thank you in advance for your reply

  4. #4
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: update query not updating (Access 2000)

    Are you linking the tables on the ProductID field or what? There has to be a connection between the two tables in order to update the correct records.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •