Automatically update similar records

  • Thread starter Thread starter Poindexter
  • Start date Start date
P

Poindexter

Hello all. I have a question to ask the MS Access Brain Trust.

I have a table with 6 fields :

A B C D E F


If were to add a record with values for A, B, C, D, (but E and F are
Null) I would like to run a query (or automatically would be better)
that would look for identical values in A, B, C, D in previous records
(that have values for E and F) and if A,B,C,D are all equal between
the new and the old records, update the E and F fields of the new
record with the E, F fields of the old record.

Does that make any sense?
 
Create two queries: one that returns rows where E and F are not null
(qryNotNull), and one that returns rows where E and F are null (qryNull).

Treat the two queries as though they're separate tables, and write an Update
query to update those rows in qryNull that match qryNotNull.
 
I'll give that a try, thanks!

Create two queries: one that returns rows where E and F are not null
(qryNotNull), and one that returns rows where E and F are null (qryNull).

Treat the two queries as though they're separate tables, and write an Update
query to update those rows in qryNull that match qryNotNull.

--
Doug Steele, Microsoft Access MVPhttp://I.Am/DougSteele
(no e-mails, please!)










- Show quoted text -
 
Poindexter said:
I'll give that a try, thanks!

Just a thought: what are you going to to if there are more than one query
with identical A, B, C, and D, but those with values in E and F do not have
the _same_ values in E and F? You'll need to determine a business rule for
choosing which to use.

Larry Linson
Microsoft Access MVP
 
Back
Top