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 / October 2004

Tip: Looking for answers? Try searching our database.

Change views based on User ID

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Angie Penberthy - 30 Sep 2004 16:50 GMT
This is what I have been tasked to do, any suggestions
and code would be very helpful.  Thank you in advanced,
maybe some day I can be assistance to you when I get
InfoPath figured out.
Angie

Task:

When someone opens the form, I need InfoPath to ask for
their employee#.  Based on that employee number a view is
displayed.  I started out with an onloadevent to prompt
for the value (employee#).  I have no idea what the code
is to get the value.   Once I had that value, I wanted to
set up a rule that said...IF = E1234 then show View
E1234.  If = E4567 then show View 4567.  Can someone tell
me if I am on a right track and if so, how would I go
about coding this.
Thanks,
Angie
ElVino - 01 Oct 2004 14:43 GMT
clo Angie

If you use a text box bound to a node you can then place a button next to it
and use some code like this:

function btnOK::OnClick(eventObj)
{
try

var sUser

sUser =
XDocument.DOM.selectSingleNode("/my:document_element/my:root/my:user_id").text

switch(sUser)
     {
          case '123':
               XDocument.View.SwitchView("vw123");
               break;
          case '456':
               XDocument.View.SwitchView("vw456");
    break;   
         default:
                XDocument.UI.Alert('UserID Unknown');
         }
catch(err)
{
          XDocument.UI.Alert(err.description)
}   

> This is what I have been tasked to do, any suggestions
> and code would be very helpful.  Thank you in advanced,
[quoted text clipped - 15 lines]
> Thanks,
> Angie
 
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.