You are here: > ESRI Forums > arcgis desktop discussion forums > Thread Replies

ArcGIS Desktop Discussion Forums

ArcGIS Desktop - Attribute Tables forum

Using VBA Functions in the Field Calculator   Don Kass Feb 23, 2006
Re: Using VBA Functions in the Field Calcul...   Dan Patterson Feb 23, 2006
Re: Using VBA Functions in the Field Calcul...   Don Kass Feb 24, 2006
Re: Using VBA Functions in the Field Calcul...   Jeff Arnett Sep 11, 2006
Re: Using VBA Functions in the Field Calcul...   Neil Clemmons Sep 11, 2006
Re: Using VBA Functions in the Field Calcul...   Jeff Arnett Sep 11, 2006
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Using VBA Functions in the Field Calculator 
Author Don Kass 
Date Feb 23, 2006 
Message In the Field Calculator, why can't I use the function Truncate (and others), such as

MyField =

truncate([Location],4)


where [location] and MyField are both numeric fields

I've tried it in both the Pre-logic VBA code area and the simple area. 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Using VBA Functions in the Field Calculator 
Author Dan Patterson 
Date Feb 23, 2006 
Message check this site
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/vtorifunctions.asp 
  Geomatics, Carleton University, Ottawa, Canada 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Using VBA Functions in the Field Calculator 
Author Don Kass 
Date Feb 24, 2006 
Message That reference doesn't help. In fact it doesn't even list truncate as a function.

I've looked up "truncate" in ArcGIS help under functions>numeric functions. It is listed as a function available (I think) in ArcMap and is suspose to work with shape files and geodatabases.

My problem is that when I try to use it as in my example above, I get the error message "type mismatch: "truncate" "

What am I missing or what isn't loaded that is supose to be loaded? 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Using VBA Functions in the Field Calculator 
Author Jeff Arnett 
Date Sep 11, 2006 
Message Hi Don,

Any luck with the TRUNCATE numerical function? I am trying to use it in a label expression as a way to specify significant digits for an integer field. The ROUND numerical function works fine in a label expression but I've had no luck with TRUNCATE.

Regards,

Jeff 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Using VBA Functions in the Field Calculator 
Author Neil Clemmons 
Date Sep 11, 2006 
Message Truncate is not a VBA function. 
  Neil Clemmons
Senior GIS Developer
Geographic Information Services, Inc.
Birmingham, AL
http://www.gis-services.com

Check out our blog:
http://blog.gis-services.com/ 
   
Report Inappropriate Content • Top • Print • This Forum is closed for replies.    
Subject Re: Using VBA Functions in the Field Calculator 
Author Jeff Arnett 
Date Sep 11, 2006 
Message Neil,

Thanks for the tip! After looking around ArcMap Help a little more I figured out that some functions exist as both VBA and SQL Numeric (ROUND, COS) while others do not. The LEFT and RIGHT VBA functions worked fine for trimming values in a Label Expression.

Regards,
Jeff