eckertda

VBA code for querying multiple attributes and adding values based on query results

Discussion created by eckertda on Aug 18, 2011
I have been struggling with this problem for some time. I need to write some code that will query a feature class for all duplicates (meaning grouping of duplicates) and from those groups of duplicates select only the groups that have a second attribute that is different, then add a "YES" or "NO" to a third attribute field.

Example of field 1&2 attributes and field 3 results.

[Field_1]____[Field_2]____[Field_3]
A01________Dude_______YES          
A01________Dude_______YES  
A01________Guy________YES
A03________Buddy______NO
A03________Buddy______NO
A04________Guy________NO

So essentially, if [Field_1] values are the same and [Field_2] values are different then [Field_3] values are "YES" for all records that have that [Field_1] value.

It is very confusing to explain so I hope the example I have given gets the point across to what I am trying to accomplish.

Outcomes