VBscript to calculate field

389
1
01-06-2011 12:10 AM
JacobusStrydom
New Contributor
Hi,

I???m having trouble with the field calculator function I???m using in my VB code.
It calculates to field but closes all user forms.

Can someone give me an example of code on how to calculate the selected records in a attribute table please.

Below is my code, but like I said it???s not working so I want to replace it with some thing better.

'Private Sub CalcTeam_1_Click()
-------------------------------------------------------
calculate points to Team_1
' --------------------------------------------------------'

Create the Geoprocessor object
Set GP = CreateObject("esriGeoprocessing.GPDispatch.1")

' Load required toolboxes...
GP.AddToolbox "C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Data Management Tools.tbx"
GP.AddToolbox "C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Analysis Tools.tbx"

' Local variables...
PointsNE_ = "PointsNE_"
PointsNE___2_ = "PointsNE_"
Team_1_shp = "C:\IssueTo\Team_1.shp"
PointsNE___3_ = "PointsNE_"

' Process: Calculate Field...
GP.CalculateField_management PointsNE_, "AllocatedT", """Team_1""", "VB"

End Sub
0 Kudos
1 Reply
NealBanerjee
Occasional Contributor
Did you ever get a solution for this?  Im trying to do the same thing.
Thanks
Neal
0 Kudos