Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / January 2006

Tip: Looking for answers? Try searching our database.

Closing Form in the OnLoad Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Christians Izquierdo - 13 Jan 2006 22:49 GMT
Hi,

I need to close an InfoPath form in the OnLoad Event. My Form loads
drop-downs from web services that might or might not be available. If any of
these web services are offline there is no point for my form to load. I would
like to just display an error to the user and close the Form.

Can this be done? I have noticed that most methods to close a form cannot be
called from the OnLoad Event. Is there any way to do this? This seems to be a
very basic task.

Thanks for your Help,
     Regards,
          Chris
Franck Dauché - 16 Jan 2006 14:18 GMT
Hi,

One possible workaround is to add a view with your custom message.  OnLoad,
you test your WS and you point your users to your main View is the test is
passed, otherwise you default the form on the View just added where the
message is displayed.

Hope that it helps.

Regards,

Franck Dauché

> Hi,
>
[quoted text clipped - 10 lines]
>       Regards,
>            Chris
Christians Izquierdo - 16 Jan 2006 18:57 GMT
I tried to call thisXDocument.View.SwitchView in the OnLoad event and I got a
NullReferenceException. I also tried to do it by setting a field in the
document and adding a rule to the Open Behaviour but that doesn't seem to
work either.

What am I doing wrong?

Thanks and regards,
   Chris

> Hi,
>
[quoted text clipped - 23 lines]
> >       Regards,
> >            Chris
Franck Dauché - 17 Jan 2006 02:40 GMT
Hi,

You need to set the default view:
thisXDocument.ViewInfos["YourViewName"].IsDefault = true;

Hope that it helps.

Regards,

Franck Dauché

> I tried to call thisXDocument.View.SwitchView in the OnLoad event and I got a
> NullReferenceException. I also tried to do it by setting a field in the
[quoted text clipped - 33 lines]
> > >       Regards,
> > >            Chris
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.