var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Compare two fields and update a third field
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.
Table B is the current status of the object:
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 by dknj30; 04-23-11 at 21:43.
Reason: ease of reading
You can do it in SQL:
UPDATE Table_A INNER JOIN Table_B ON
Table_A.AFTER = Table_B.COLOR
SET Table_A.VALIDATED = True
Have a nice day!
Tags for this Thread