Solved

MS access 2013 Append to destiation table and set values in source table in one go

Posted on 2016-08-02
4
26 Views
Last Modified: 2016-08-22
Hello, thanks for reading and offering some expert help on my Access question.    Many books, searches and thoughts later I see cannot figure out a way to solve this problem.  I've created a simple DB sample and attached to this question.

Two tables  ITEMS and PROCESSED
rows in ITEMS get marked as 'SOLD'

Append query then looks for rows 'SOLD' and appends data to PROCESSED

(so far so good)

but during the append I'd like to set the row in the source table ITEMS to 'COMPLETE' and 'COMPLETETIMEPSTAMP' set to =now()

(this I cannot figure out)

I have found that using query expressions I can set/change going to the destination table, example I can set the notes field in the destination table.

How can I set a value in the source table during this operation ?

I hope the PDF and sample DB make sense.

Long story short:
Each day the 'SOLD' records are "copied" between two different databases (imagine two departments that use the data in completely different ways).   I want to show in the ITEMS table that the record was 'sent'.
DB-query.pdf
Question.accdb
0
Comment
Question by:pc-cyt
  • 2
4 Comments
 
LVL 36

Expert Comment

by:PatHartman
ID: 41739869
These are two different operations on two different tables and must be done separately.  So - you need both an update query and an append query.

Since you want both to work or both to fail, run the action queries within the same transaction.
0
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 250 total points (awarded by participants)
ID: 41739889
here see query my_update, run it after the append query
Question_revised.accdb
0
 
LVL 50

Accepted Solution

by:
Gustav Brock earned 250 total points (awarded by participants)
ID: 41740294
Here is how.

First, change the data type of ItemID to Long (done in the attached sample)
Then run the queries when you think new items are ready:

    AppendItems
    ProcessedItems

However, you can run these queries as often as you like as they only process records that hasn't been touched before.

/gustav
Question.accdb
0
 
LVL 50

Expert Comment

by:Gustav Brock
ID: 41765034
At least one proved solution offered.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MS Access Query Question 2 36
Using a combo box ListItemsEditForm property 5 45
VBA code to use a table to create a new temp table with a column added 4 36
ORDER BY 7 40
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question