I am having the same problem. I am not sure what is the issue. I am using VBScript as my language. I have a submit button that saves the info and closes the form. The code below is all I have for the OnSaveRequest. I am new to InfoPath and this site.
Sub XDocument_OnSaveRequest(eventObj)
' Write the code to be run before saving here.
eventObj.IsCancelled = eventObj.PerformSaveOperation
' Write the code to be run after saving here.
Application.ActiveWindow.Close True
eventObj.ReturnStatus = True
End Sub