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?