Hi,
I bet the XPath is not right. Try this first:
Start a new blank InfoPath / VB.Net project
Add 1 field (string), called: GrpName.
Drop a button on your form and add that line of code:
<InfoPathEventHandler(MatchPath:="CTRL1_5", EventType:=InfoPathEventType.OnClick)> _
Public Sub CTRL1_5_OnClick(ByVal e As DocActionEvent)
thisXDocument.DOM.selectSingleNode("/my:myFields/my:GrpName").text = "test"
End Sub
Once you you get that working, go back to your form and right click on your GrpName field in your schema:
Go the Validation and Event Handlers Tab
Select the OnBeforeChange Event
Click Edit.
The MatchPath will give you your exact XPath.
Use that, it should help.
Regards,
Franck Dauché