'This is assuming that the code is executed from the onload event of the identifyform. Dim query, ownername, thedatasource ' form layer datasource, which you need to execute SQL commands thedatasource = ThisEvent.Object.Parent.Datasource 'note the single quotes enclosing the string we're querying against at the end query = "SELECT [OWNERS NAME FIELD] FROM [TABLE RELATED TO PARCELS] WHERE [PRIMARY KEY FIELD] = '" & ThisEvent.Object.Fields("PrimaryKeyField").value & "'" 'returns a recordset object, see the help for other methods you can use. It will only contain the 1 field you queried for above ownername = thedatasource.Execute(query) 'Assign the value you got to the empty editbox you set up. ThisEvent.Object.Pages("Page1").Controls("empty edit box for storing the owners name").value = ownername.Fields("OWNERS NAME FIELD").value
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.