Hi Jeff, that's really helpful as I'm trying to do something similar. I want to add the contents of a number of fields and autopopulate a "Tally" field with the sum of these fields. I used your code, but when I substituted "+" for "-" it doesn't work. eg. If I enter "100" for the well depth and "20" for the GW depth, the water column thickness field is autopopulated with "10020". I'm not sure what he problem is - it appears to be adding the text string rather than the numerical values. The code (called from the Onchange event in the GW depth field) I used was:Sub SumFunction Set objControl= ThisEvent.Object Set objPage= ThisEvent.Object.Parent GWDepth= objControl.Value WaterColumnThickness= objPage.Controls("TxtWell_Dep_TOC").Value + GWDepth objPage.Controls("TxtWat_Column").Value= WaterColumnThicknessEnd SubAny ideas?
Hi,The value of an Editbox control is string. It might help if you use the field property of the controls to get the numbersGWDepth= objControl.Field.ValueWaterColumnThickness= objPage.Controls("TxtWell_Dep_TOC").Field.Value + GWDepth
Great - that worked! Thanks Rui, and thanks Jeff for the additional script
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.