-
Thank you so much for updating - I love it when people come back and do this so that others will actually find a solution instead of just another question! :)
-
Are you using IP 2010? If so, I'd expect the code to open in VSTA. What version of IP are you using? What is the development environment you used to write the code originally?
-
Or you could create a single query, and requery with different data as needed. Just make sure you don't check the box to return data on load and then give it a try - just drag the query and data fields onto your form and add a button that executes the query - then you can test it out a bit and get a feel for what I'm trying to describe. :)
-
See if this does what you want as far as resetting the value.
-
I must not be explaining correctly then - because what I am describing would be a method of only loading some items into your form.
-
In InfoPath 2010, a SharePoint List data connection has query fields.
So, when you create the SharePoint List data connection (just a regular list data connection) in the last screen of the data connection wizard, you can deselect the checkbox for automatically loading data when the form opens - you don't want that.
Then, in your form, if ...
-
Are you using InfoPath 2010? Or 2007? I ask because if you are using 2010, you should have list query fields in your data connection to your list that you can use for equivalency queries.
-
Yes, but I mean run the form in preview on your machine and debug the code from Visual Studio. http://msdn.microsoft.com/en-us/library/aa947485(v=office.11).aspx
-
Have you actually run the code in debug? With a break point on the first line (the if statement)?
-
I'd add a helper field to the data source - a boolean, false by default, and set it true when the button is clicked. Conditional formatting could be based on its value.