Results 1 to 4 of 4
  1. #1
    sarsmelt is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    17

    Update multiple unrelated fields

    Is there any way for me to update fields in the same table that are completely unrelated in one query?

    This is the code I have so far
    UPDATE Product_Code_Data SET Product_Code_Data.Machine1 = "DGM2", Product_Code_Data.Machine2 = "DGM2", Product_Code_Data.Machine3 = "DGM2", Product_Code_Data.Machine4 = "DGM2"


    WHERE (((Product_Code_Data.Machine1)="test") OR ((Product_Code_Data.Machine2)="test") OR ((Product_Code_Data.Machine3)="test") OR ((Product_Code_Data.Machine4)="test"));
    but it updates every Machine if one field contains "test"

    What I want it to do is search each field individually and then make the decision if something needs to be updated.

    Is this possible or do I have to make separate update queries?

    Thanks!
    Sarah

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    Whatever logic works. If you can put it in 1 query fine.
    If it takes many queries, thats fine too.
    Stick them all in a macro and run as many queries as you need.
    It dont cost nuthin.

  3. #3
    sarsmelt is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    17
    If I put them in a macro though how can I change the criteria/update to?

  4. #4
    sarsmelt is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2014
    Posts
    17
    Nevermind I'm going to use parameters.

    Thanks for the help!

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

Similar Threads

  1. Replies: 5
    Last Post: 04-05-2013, 12:02 PM
  2. update multiple fields
    By slimjen in forum Queries
    Replies: 4
    Last Post: 01-27-2012, 10:12 AM
  3. Update Multiple fields according multiple criterias
    By denis.m in forum Programming
    Replies: 1
    Last Post: 02-21-2011, 11:03 AM
  4. Combine two unrelated tables with the same fields
    By lghovden06 in forum Queries
    Replies: 4
    Last Post: 07-27-2010, 03:36 PM
  5. Replies: 1
    Last Post: 07-07-2009, 01:00 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