[GIS] How to use VBA in the field calculator, to copy the last 7 characters to a new field

arcmaparcpyfield-calculator

Im using ArcMap 9.3. Im looking for a VBA code to use in the field calculator to make a new field of the last 7 digits of a "pin" field. For example. my pin is 00-00-999-999 and i want it to display as 999-999 in my new field. Anybody have code for this?

Best Answer

Here is a link to an Esri tech article "HowTo: Use VBA functions in the Field Calculator." Take a look at the Right Function which "...Returns a Variant (String) containing a specified number of characters from the right side of a string." An example is included on the page. You will have to add the new field separately, then use the right function to calculate the value.

http://support.esri.com/en/knowledgebase/techarticles/detail/31807

Related Question