Hi
Are per a previous post, there seems to be no ActiveLayer for vba, but I can do without this. I load a number of layers and only want the identify to work on certain layers. I read that the default for identifiable is false, but it still seems to be identifying on the layer. I have an Operational Entity polygon layer that is always at position 0. It always brings this up when I loop through the ShapesIdentified and I set it myself to shpOpEntity.Identifiable = False. I have a lot of layers loading but have only set ShpRdLineBackground when I test as it seems to ignore this anyway
see code
shpRdLineBackground.Identifiable = True
Set shpOpEntity.Identifiable = False
With Map1.Identifier
.IdentifierMode = tkIdentifierMode.imAllLayers
.OutlineColor = RGB(0, 0, 255)
.HotTracking = False
End With
In the following sub
Private Sub Map1_ShapeIdentified(ByVal LayerHandle As Long, ByVal shapeIndex As Long, ByVal pointX As Double, ByVal pointY As Double)
I loop through the IdentifiedShapes and go different things for each Layer I find
eg sample
Set shapes = Map1.IdentifiedShapes
For i = 0 To shapes.Count - 1
hnd = shapes.LayerHandle(i)
If hnd = 0 Then
GoTo NextLoop
End If
If hnd = hndAccidents Then
fieldIndex = shpAccidents.Table.FieldIndexByName(“LocnCode”)
Me![LocationCode] = shpAccidents.CellValue(fieldIndex, shapes.shapeIndex(i))
DoCmd.OpenForm “DisplayLocnAccsForm”
Exit Sub
End If
Whole lot more tests
Next
I ignore hnd = 0 as this is my Operational Entity Layer that it still seems to be finding. Also when I highlight the shape eg an Accident Location, it also highlights the Operational Entity Layer below this and I can’t remove the highlighting. I tried to remove this by setting HotTracking to false, but it still highlights. I like the highlight of the Accident Location, but not the polygon behind.
Thanks for any help you can give me.
Regards
Colleen Crawford