sub countRecords Dim ds Dim query Dim qRows Set ds = Map.Layers("FieldPoints").DataSource set flds = ThisEvent.Object.Fields fid = flds("FIELDPOINTS_ID").VALUE 'Sets fid to the fk query = "SELECT COUNT(AXF_OBJECTID) FROM [LITHOLOGY] WHERE [FIELDPOINTS_ID] =" & fid Set qRows = ds.execute(query) 'Execute Query qrows.movefirst 'Read results countRec = qRows.fields(1).value flds("LITHORDERNUMBER").value = countRec + 1 End Sub
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.