-
Greg, Jimmy, thanks for your input!
I did find a workaround for it. If my custom validation fails, I set a field value in the newly opened form (Form B) to "Abort". From the opening form (A), I can check this field value and if it is "Abort" I can close Form B from there using one of the methods above.
-
Thanks again, Jimmy.
As far as moving the text fields up and/or down, the code that worked and prevented duplications of text fields was very close to yours, as follows:
public void btnMoveUp_Clicked(object sender, ClickedEventArgs e)
...
-
[quote user="b.harrison"]I just remembered that, although we are developing on 2007, we are using the backward compatibility option with 2003 (most of our users only have 2003 on their PCs). This might be why it does not work?
[/quote]
Sure is :-)
thisXDocument.View.Window.Close(true);
should do the trick.
Edit: ...
-
If you read through the documentation you discover:
[quote]"the Close method can only be used with the OnSubmitRequest and OnClick event handlers. If used with any other type of event handler, it will return an error."[/quote]
I hope that helps.
-
Thanks, Hilary, but I am getting a build error when I try that.
When I type just "this." in visual studio, the intellisense brings up the list of all of the methods and members of the current class. Is there something I need to do to make the this refer to the current document and not the current class?
I just remembered that, ...
-
this.Close(); will close the form.
-
-
What version of InfoPath are you using? 2003 or 2007? C# for your code?
-
-
Wonderful! Yes, walking throught the data connection wizard does refresh the schema. I'm glad this worked for you -- it can be a real time-saver.