Results 1 to 2 of 2
  1. #1
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59

    Update Query: Modifying Data Using Top Values

    Background: I am trying to set up a quality program in my facility to monitor an individual's inventory putaway accuracy. Every day, thousands of products are received from our suppliers and put away into storage in our warehouse. I have records for each of these transactions. To ensure accuracy, I would like to begin having a person going behind these putaways and verifying that they are correct. Since there are so many transactions per day and only one employee to verify them, I'll only be able to select a small sample population to analyze. This part of the project only deals with how to go about differentiating the records we have selected for verification from the total record pool.



    Ideally, I would like to create a report that lists X number of putaway transactions (lets say 50). Once the report has been run, I would like to update the table containing putaway transaction data to show that these records have been verified/printed. If the employee completes this list of 50, I would like to rerun the report for a new set of 50 unprinted/unverified records, update those 50 records to show that they have been printed/verified, allow the employee to complete the verification process, and continue this process infinitely.

    Does anyone know a good way to approach this? I tried to create a report along with a similarly structured UPDATE query/SELECT TOP 50 subquery. I never got it to work and kept getting an error saying something like "At most this subquery must return one record." I've attached a sample of my table and it's data for reference. If any additional information is required, don't hesitate to ask.
    Last edited by William McKinley; 11-30-2010 at 02:20 PM.

  2. #2
    William McKinley is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Jul 2010
    Posts
    59
    Solved using this update query/subquery.

    Code:
    UPDATE [Receiving Transactions] SET Verified = "YES"
    WHERE HistorySequence IN (SELECT TOP 5 [Receiving Transactions].HistorySequence
    FROM [Receiving Transactions]
    WHERE TeamName = "XXX" AND PriorOnHand = 0 AND Verified Is Null ORDER BY HistorySequence DESC);

    Also, I attached this query to an On Click event procedure for a command button on the report. Works like a charm!

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

Similar Threads

  1. Modifying a Split Form?
    By robertrobert905 in forum Access
    Replies: 0
    Last Post: 10-26-2010, 08:00 AM
  2. Update query to summarize multiple values
    By ser01 in forum Queries
    Replies: 3
    Last Post: 05-15-2010, 09:38 AM
  3. Modifying an import specification
    By ronzul in forum Import/Export Data
    Replies: 3
    Last Post: 11-12-2009, 05:03 AM
  4. Modifying Update Query
    By James Elvin in forum Queries
    Replies: 0
    Last Post: 10-14-2008, 09:07 AM
  5. Replies: 1
    Last Post: 03-17-2006, 12:04 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