5

I am trying to use ArcMap's Field Calculator to populate values in a column based on a value in another column. So, in pseudo-code:

if [field1] = 'Foo'
 set [field2] = 'Bar'
endif

Something like that. Test for 'foo' in the first attribute, and set the record's second attribute to 'bar.' Seems like it should be pretty easy to do, but I keep receiving a "user interrupt" error every time I try running anything. I think I have a misunderstanding of how to build VBA expressions with the Field Calculator...

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Sep 15, 2010 at 19:32
1
  • What version of arcmap? I think VBA in the field calculator got deprecated at 10.0. Here's a good intro to the python calculator. Commented Mar 1, 2011 at 14:50

1 Answer 1

13

Try something like this:

dim f2
if [field1] = "foo" then
 f2 = "bar"
end if

Screen shot of this being used in the field calculator.alt text

answered Sep 15, 2010 at 19:42
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.