Change records in query (1 Viewer)

Gavx

Registered User.
Local time
Today, 21:21
Joined
Mar 8, 2014
Messages
151
I am running a query that compares table A with table B and returns records in A that are not in B.
There is a checkbox field in table A which I want to be able to check if it is returned in the unmatched records query.

Unfortunately I cannot update the checkbox field in the query because, I assume, table A does not contain a primary key.

I am unsure how to proceed.

Is it via an update query?

Thanks
 

isladogs

MVP / VIP
Local time
Today, 10:21
Joined
Jan 14, 2017
Messages
18,186
You should have a PK field in all tables and its vital when running action queries so that Access can correctly identify the records to be altered. In this case which to update.

However you might be able to do an update query based on your unmatched query if you
1. First index one or more fields that will make each record unique
2. Set the update query for unique records =yes.
The query SQL will start UPDATE DISTINCTROW....

For further info and other possible solutions, look at the second part of this article which covers the situation where the import table has no PK
http://www.mendipdatasystems.co.uk/synchronise-data-2/4594514002
 
Last edited:

theDBguy

I’m here to help
Staff member
Local time
Today, 03:21
Joined
Oct 29, 2018
Messages
21,357
Hi. Just curious, can you please post the SQL statement for your query? Thanks.
 

Users who are viewing this thread

Top Bottom