Infopath change view error

N

Nick

When the view is switched to a particular view, I have the OnSwitch event
fire, and say:
if(e.XDocument.View.Name == "SomeView" && someothercondition)
{
e.XDocument.View.Switch("NewerView");
}

When I try this, it give me a Com exception error, and says the view is not
ready.
Any insight?
 
Top