I'm new to VBA, intermediate SQL. I've been scouring the web for an answer - and can't find anything similar... or perhaps I'm searching for the wrong thing! I'm using Access 2007.
I want to compare two columns from two different tables and then update another column.
Table A is an audit trail.
ID--CHANGETYPE--OBJECTID---BEFORE--AFTER--VALIDATED?
1---ColorChange--Object1-----Red------Blue----No
Table B is the current status of the object:
OBJECTID---COLOR
Object1-----Blue
So using the sample data above: Table A says Object1 should be Blue now because it had a color change. Table B says Object1 is currently Blue.
So I would like to create some vb code that goes something like this:
For each row...
If tableA.ChangeType = "ColorChange" then
if tableA.After = tableB.Color then
set tableA.Validated to "Yes"
Thanks in advance for the assistance!!!
I want to compare two columns from two different tables and then update another column.
Table A is an audit trail.
ID--CHANGETYPE--OBJECTID---BEFORE--AFTER--VALIDATED?
1---ColorChange--Object1-----Red------Blue----No
Table B is the current status of the object:
OBJECTID---COLOR
Object1-----Blue
So using the sample data above: Table A says Object1 should be Blue now because it had a color change. Table B says Object1 is currently Blue.
So I would like to create some vb code that goes something like this:
For each row...
If tableA.ChangeType = "ColorChange" then
if tableA.After = tableB.Color then
set tableA.Validated to "Yes"
Thanks in advance for the assistance!!!
Last edited: