Programmatically changing the default view of an InfoPath form (on Load) via VB - InfoPath Dev
in

InfoPath Dev

Programmatically changing the default view of an InfoPath form (on Load) via VB

Last post 01-17-2013 09:29 AM by ZtBoy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-08-2009 01:44 PM

    Programmatically changing the default view of an InfoPath form (on Load) via VB

    Guys,

     How would I programmatically change the default view of an InfoPath form (on Load) via VB?  I've found the following code snippets:

    BLOCKED SCRIPT
    XDocument.ViewInfos("My View Name").IsDefault = true;

    C#:
    thisXDocument.ViewInfos["My View Name"].IsDefault = true;

    ...but none of them refer to the VB code that does this.  Any help would be GREATLY appreciated.  Thanx-so-much..!

     - Tav

     

     

    - Tav
  • 04-08-2009 03:54 PM In reply to

    Re: Programmatically changing the default view of an InfoPath form (on Load) via VB

    Hi:

    Are you using VB.NET? InfoPath 2007 would be, in the loading event for the form:

    e.SetDefaultView("View2")

    With View2 replaced with the name of your view. InfoPath 2003 would be, in the onload event for the form:

    e.XDocument.ViewInfos("View2").ISDEFAULT=True

    Hilary Stoupa

  • 04-09-2009 09:05 AM In reply to

    Re: Programmatically changing the default view of an InfoPath form (on Load) via VB

    Thanx Hilary!!!  You're great; you really are...

    That's exactly what I needed! 

     You have a nice one..!

     

    - Tav

    - Tav
  • 01-17-2013 09:29 AM In reply to

    • ZtBoy
    • Not Ranked
    • Joined on 01-17-2013
    • Posts 1

    Re: Programmatically changing the default view of an InfoPath form (on Load) via VB

    How would you accomplish this using InfoPath 2010 and VB OnLoad? Thanks!
    Filed under: ,
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.