InfoPath 2007 / VSTO - Switch View on Form Load

S

Scott

How can you switch views via VB.Net/C# during the loading of an InfoPath 2007
form? I've tried to do this during the OnLoading event but it errors and says
it's not allowed.
 
A

Andy Bonner

To get over this I add a field to my main data source to hold the name of
the view I want. I set this fields value in the FormEvents_Loading based on
who is opening the form.

Then all you need to do is in the Form Options dialog, under the Open and
Save category, click the Rules button & add in rules to switch to the
appropriate view depending on the fields value.

It works a treat.
 
S

Scott

Works great! Thanks.

Andy Bonner said:
To get over this I add a field to my main data source to hold the name of
the view I want. I set this fields value in the FormEvents_Loading based on
who is opening the form.

Then all you need to do is in the Form Options dialog, under the Open and
Save category, click the Rules button & add in rules to switch to the
appropriate view depending on the fields value.

It works a treat.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top