Increment a numeric value

Have you ever wanted to increment or increase the value of a field by 1 or a fixed amount? Here are the steps to do so in ArcMap 9.x:

1. Add or use an existing numeric field(Short Integer, Long Integer, Double).
2. Start an edit session.
3. Right click on the numeric field from step 1, and click Calculate Values.
4. Check the Advanced check box.
5. Paste in the following code into the Pre Logic VBA Script code:

Static rec As Long
Dim pStart As Long
Dim pInterval As Long

pStart = 1
' Make pStart equal whatever number you want to start at.

pInterval = 1
' Make pInterval equal whatever number you want to increment by.

If (rec = 0) Then
rec = pStart
Else
rec = rec + pInterval
End If

6. Type the word "rec" into the bottom text box (below fieldname =).
7. Hit the OK button to run and remember to Save your edits.

This was based on the instructions at: http://support.esri.com/index.cfm?fa=knowledgebase.techarticles.articleS...

increament a numeric value to desired feature (Area,line,point)

Dear karl,

i went thro ur value increment script, its really good and helped me. i'm research scholar in GIS field with poor knowledge in programming. i've a clarification, is it possible to increment a value for user specified feature (polygon, line, point). for e.g i'm selecting a point and assigning its value as 1, then when i select another point it should be automatically entered as 2 and soon on.....(for user desired features, not generating for all features at a stretch, since my GIS features have some hierarchy to be followed )plz help me i this regard....

thanks in advance....

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
This question is test that you are human and not a spammer. (All upper case letters or numbers)
Image CAPTCHA
Copy the characters (respecting upper/lower case) from the image.