Expected end of statement - InfoPath Dev
in

InfoPath Dev

Expected end of statement

Last post 12-05-2007 06:26 AM by m181354. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-04-2007 06:57 AM

    Expected end of statement

    I am getting the following error.  Does anyone know how to fix it?

    Expected end of statement
    File:script.vbs
    Line:102
    Dim Domain As String = thisXDocument.DOM.selectSingleNode("/xmlns:myFields/my:Domain") 

    The rest of the code looks like this...

    Sub CTRL22_5_OnClick(eventObj)

     Dim Domain As String = thisXDocument.DOM.selectSingleNode("/xmlns:myFields/my:Domain")

     Dim UserID As String = thisXDocument.DOM.selectSingleNode("/xmlns:myFields/my:UserID")

    Set objNetwork = CreateObject("Wscript.Network")

    UserID = objNetwork.UserName Domain = objNetwork.UserDomain

    End Sub

     

     

     

    Filed under: ,
  • 12-04-2007 07:39 AM In reply to

    Re: Expected end of statement

    I do not see anything in the syntax here. I am wondering if it is just above this code.  Are you ending the previous Sub?

    If you need an active directory web service to return username, domain, name, email etc then there is one included with the Database Accelerator or you can get it on its own. Qdabra Database Accelerator Suite Version 2.1 - Developer

  • 12-04-2007 09:32 AM In reply to

    I attached my xsn file for your review.  It is very small. I am purchasing your web service for Active Directory.

    Filed under:
  • 12-04-2007 10:21 AM In reply to

    Re: Expected end of statement

    One thing for your var Domain as String = XDocument.DOM.selectSingleNode("/xmlns:myFields/my:Domain") you need the .text on the end if you want the value to transfer.

    It looks to me you want to set the values the other direction XDocument.DOM.selectSingleNode("/xmlns:myFields/my:Domain").text = objNetwork.Domain

    With the AD service you can get the values in your form without code or anything.

  • 12-05-2007 06:26 AM In reply to

    Re: Expected end of statement

    I purchased the AD Servise for a project I am working on.  This code is for a co-worker.  Why do you need the ".text' extension sometimes but not others?  I did not use it here..

    var ecamOfObs = XDocument.DOM.selectSingleNode("/dfs:myFields/my:FormData/my:ECAM_of_OBS");

    or 

     var now_etc_hrs = XDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/d:LaborSummary[ @AUTONUMBER = '" + detailId + "']/@NOW_ETC_HRS" );

    I tried the change you suggested but still get this error....

    InfoPath cannot open the selected form because of an error in the form's code.
    The following error occurred:

    Expected end of statement
    File:script.vbs
    Line:104
    Dim XDocument.DOM.selectSingleNode("/xmlns:myFields/my:Domain").text = objNetwork.UserDomain

    Code is below...

    Sub CTRL22_5_OnClick(eventObj)

    Set objNetwork = CreateObject("Wscript.Network")

    Dim XDocument.DOM.selectSingleNode("/xmlns:myFields/my:Domain").text = objNetwork.UserDomain

    Dim XDocument.DOM.selectSingleNode("/xmlns:myFields/my:UserID").text = objNetwork.UserName

    End Sub

    The problem may be with this code...

    Set objNetwork = CreateObject("Wscript.Network")

     

    Filed under:
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.