You cannot switch views twice in a row. But you can use the OnContextChange event handler to identify that you are now in your "Export" view and then switch back to the other view. If you reach the Export view from multiple other views, then store somewhere in a secondary data source, the view you are switching form, and then switch back to the stored view.

Signature
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Visit InfoPath Dev ( http://www.InfoPathDev.com )
ridawg - 22 May 2006 20:30 GMT
Greg,
Thanks for the info. How do I use the OnContextChange event in this
situation? I apogolize for my ignorance - I have very little programming
experience. If you could walk me through what your thinking that would be
great.
Thanks!

Signature
-ridawg
> You cannot switch views twice in a row. But you can use the OnContextChange event handler to identify that you are now in your "Export" view and then switch back to the other view. If you reach the Export view from multiple other views, then store somewhere in a secondary data source, the view you are switching form, and then switch back to the stored view.
Greg Collins [InfoPath MVP] - 23 May 2006 00:40 GMT
In the OnContextChange event handler you write some code to see if you are in the Export view... if you are, then you switch views back.
The OnContextChange event won't happen until all your other code (the view switch and export) is done.

Signature
Greg Collins [Microsoft MVP]
Visit Brain Trove ( http://www.BrainTrove.com )
Visit InfoPath Dev ( http://www.InfoPathDev.com )
ridawg - 23 May 2006 14:49 GMT
Thanks for the help - I figured it out using the OnContextChange.

Signature
-ridawg
> In the OnContextChange event handler you write some code to see if you are in the Export view... if you are, then you switch views back.
>
> The OnContextChange event won't happen until all your other code (the view switch and export) is done.