TO Patrick:
In the "Using Code to Control the Sharepoint Submit Data Connection" section of your book you describe how to code a solution so that saving an existing form from a Sharepoint forms library will overwrite the existing one rather than creating a new one.
I don't have Visual Studio, so am using the InfoPath editor. I have created this code:
function XDocument::OnSubmitRequest(eventObj)
{
Dim submit As DAVAdapter
submit = thisXDocument.DataAdapters.Item("Submit")
If thisFilename Is Nothing Then
thisFilename = submit.FileName
End If
submit.FileName = thisFileName
submit.Submit()
e.ReturnStatus = True
}
I guess there is something different I must do for the InfoPath editor because this code generates an error at the first Dim statement. I also tried completing step 11, which was to add the statement "Private thisFileName As String" to the "code just above the OnSubmitRequest event handler. That also generates an error.
I would be very appreciate of any help to creating this solution.
One other problem with this solution, though, is that I have "Submit with Rules" chosen. Your instructions say to "Submit with Code." If I chose Rules, will it then go to the code to look at the OnSubmitRequest handler?
Thanks!