SwitchView Problem - InfoPath Dev
in

InfoPath Dev

SwitchView Problem

Last post 07-26-2006 01:13 AM by Kalyan Gaddam. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-28-2006 06:04 AM

    SwitchView Problem

    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) then
    XDocument.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

    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;
  • 07-25-2006 09:10 PM In reply to

    You help me a lot
    Thank you
  • 07-26-2006 01:13 AM In reply to

    Hello,

    Here is a link which helps to Switch Views Programmatically in case anyone needs
    http://www.infopathdev.com/howto/tutorials/default.aspx?i=b5613773df374e42a0dddc22acb21d8e

    Hope it helps
    Kalyan G Reddy
    Infopath MVP 2007 and 2008
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.