SwitchView Problem - InfoPath Dev Sign in | Join | Help in General InfoPath (Entire Site) InfoPath Dev InfoPath Dev is dedicated to bringing you the information and tools you need to be successful in your Microsoft Office InfoPath development projects. Home Blogs Forums Photos Downloads InfoPath Dev » InfoPath » General » SwitchView Problem SwitchView Problem Last post 07-26-2006 01:13 AM by Kalyan Gaddam. 3 replies. Page 1 of 1 (4 items) Sort Posts: Oldest to newest Newest to oldest Previous Next 06-28-2006 06:04 AM liorlankri Joined on 02-28-2005 Posts 205 SwitchView Problem Reply Contact I have a form that contain 2 views "View A" (default view)and "View B".In my OnLaod event I have this code:if Application.User.IsUserMemberOf(USER_GROUP_B) thenXDocument.View.SwitchView("View B")end if.When I run it from one machin It's work well. but I try open the form on another machin and I get error of: Object requierd: 'XDocument.View'What is the problem? (I installed the form on each machin) 07-19-2006 09:34 AM In reply to Greg Collins Joined on 08-07-2006 Posts 2,126 Re: SwitchView Problem Mark as Not AnswerMark as Answer... Reply Contact I'm suprised it ever worked. The View object doesn't exist until the OnLoad event handler has completed.A better option is to use Open Rules (see Tools | Form Options).Or, within the OnLoad event handler, you can use something like:XDocument.ViewInfos("View B").IsDefault = true; Please Visit:BraintroveGreg's Paintings 07-25-2006 09:10 PM In reply to liorlankri Joined on 02-28-2005 Posts 205 Re: SwitchView Problem Mark as Not AnswerMark as Answer... Reply Contact You help me a lotThank you 07-26-2006 01:13 AM In reply to Kalyan Gaddam Joined on 07-18-2005 India Posts 362 Re: SwitchView Problem Mark as Not AnswerMark as Answer... Reply Contact Hello,Here is a link which helps to Switch Views Programmatically in case anyone needshttp://www.infopathdev.com/howto/tutorials/default.aspx?i=b5613773df374e42a0dddc22acb21d8eHope it helps Kalyan G ReddyInfopath MVP 2007 and 2008 Page 1 of 1 (4 items) Copyright © 2003-2019 Qdabra Software. All rights reserved.View our Terms of Use.