Hi Hilary. The code we are referring to is for the RUN QUERY button. I have not modified the NEW RECORD.
I believe we are both using modified code.
I should mention that I am using infopath 2003 sp3 against SQL SERVER 2005 ent x64 sp3
I am not sure if we are using the same code. I did find it at the micrososoft site http://support.microsoft.com/kb/826992
I have modified it to work with my specific data source and situation (Master detail) My code for my modified RUN QUERY works great for returning queries.
However,when I use it to return a set of records in a master detail, then modify one of the records and Submit, then try to use the NEW RECORD button and try to SUBMIT a new record I receive the above error. If I do this same process using standard RUN QUERY button it does not happen, it works, unless....I first produce the error with my modified button then try standard button error will happen.
If I re-query after the error or after a form change/submit described above the NEW RECORD button will then work.
I hope this describes it better?
Thanks for your help.
Mark