If this is on the "OnAfterChange" event, it is because we have to go through
twice.
The first time we go though, we change the the value to blank and then we
come through again and change it to the value you selected or entered.
Try something like this:
function msoxd_my_field2::OnAfterChange(eventObj)
{
if (eventObj.IsUndoRedo || eventObj.Operation != "Insert")
{
return;
}
//do whatever you want here...
}

Signature
Jerry Thomas[MSFT]
<Jerryth@online.microsoft.com>
Microsoft Office InfoPath
---------------------------------------
This posting is provided "As Is" with no warranties, and confers no rights.
Use of any included script sample are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
Please do not send email directly to this alias. This alias is for
newsgroup purposes only.
> I have the following simple select case in my code (VB.NET managed code) to
> remove an optional section if the user selection from a dropdownlist box
[quoted text clipped - 10 lines]
> 'Mileage
> thisXDocument.View.SelectNode
(thisXDocument.DOM.selectSingleNode("/my:myFields/my:ExpenseReport/my:Expens
eReportDetail/my:MileageExpense"),
> System.Reflection.Missing.Value, System.Reflection.Missing.Value)
> thisXDocument.View.ExecuteAction("xOptional::remove",
[quoted text clipped - 6 lines]
> optional section has indeed been removed. Does anyone have any insight as to
> why this might be happening? Thanks.