Well, there are several problems with this code:
- inspdate1 would not be defined - it's a name of a data field. Typically you have to select the XPathNavigator corresponding to your data field from the DOM you're interested in. In this case, however, the navigator is available as e.Site: you get the value as e.Site.Value and you set it via e.Site.SetValue
- I don't believe you can change the value of the field in its Validating event - during this event the field is read-only
- Changing the value of the field in its OnChange event is likely to cause an infinite loop: OnChange fires, you change the value, OnChange fires again
- I don't know the details on Mid but what happens if DT is empty?
I would avoid writing any code unless you really have to. Do you want to change the data or the way it's displayed? If it's the later, then Formatting is really what you need.
David Airapetyan / Software Services ArchitectQdabra® Software / Streamline data gathering to turn process into knowledge