Calculate Field VBA Statement If...Then...Else Error

816
1
11-16-2011 02:39 AM
RoyMol
by
New Contributor
Hi,

I am not able to use an If Then Else function in my field calculator.
I've looked up loads of discussions on this forum and tried several options.
Even a basic function will not work.
Am I doing something wrong, do I have a version of AG that doesn't support this anymore or is there something else?

I'm using Arcmap 10 service pack 2 and trying the next function in my field calculator:

Pre logic script code:
Dim output as Double

If [OBJECTID]=2 Then
output = 565
Else
output = 6
End If

Field value:
output


Error code 999999 -> so that's not very helpfull...

Anyone an idea?
Thanks!
Roy
0 Kudos
1 Reply
KenBuja
MVP Esteemed Contributor
Remove the "as Double" from the dim statement.
0 Kudos