?
Solved

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

Posted on 2016-08-02
4
Medium Priority
?
28 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 38

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 1000 total points (awarded by participants)
ID: 41739889
here see query my_update, run it after the append query
Question_revised.accdb
0
 
LVL 51

Accepted Solution

by:
Gustav Brock earned 1000 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 51

Expert Comment

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

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Suggested Courses

762 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