Select to view content in your preferred language

How do I transfer attributes from polygon to point in ArcPad

654
0
11-28-2010 10:57 PM
MattJakab
New Contributor
I have an AXF file with a polygon feature class and a point feature class.  The intention is for the user to create a polygon, enter all the attributes for that feature, and then create points within that polygon.  I want to automaticallly transfer some of the attributes from that underlying polygon to the points.  As a first step I'm trying to select the feature, pass the value to a variable and display it in a message box.  It isn't recognising the polygon layer at all, and I can't figure out why.  The code thus far is here:

Dim dblX,dblY,lyrExists,objLayer,Found,objFieldName,result

Set objLayer = Map.Layers("Polygon 1")
If objLayer Is Nothing Then
  MsgBox "Facility 1 layer features are not present",vbExclamation,"Message"
  objToolButton.Click
End If

dblX = Map.PointerX
dblY = Map.PointerY

Found = Map.SelectXY(dblX,dblY)
If Not Found Then
  MsgBox "No feature found",vbExclamation,""
End If

Set objRS = objLayer.Records
objRS.Bookmark = Application.Map.SelectionBookmark
Set objFieldName = objRS.Fields("FIELD_A")
result = objFieldName.Value

MsgBox result,vbOKOnly,""


Does anyone have any ideas?
Tags (3)
0 Kudos
0 Replies