Thanks for your help. However, being new to InfoPath, I'm not really sure how to make the OnLoad handler work. Let me explain more on how I was to use it. I've written some code to run when the user clicks on the submit button. On of the final lines of code will call a data connection called "submit". I wrote the following code:
XDocument.DataAdapters("submit").Query()
When I tested it, I got the following error: ""Object doesn't support this property or method: 'XDocument.DataAdaters'". Again, I know nothing about data adapters, so if someone could help me with the correct syntax I would appreciate it.
Thanks.