to assign value to node - InfoPath Dev

InfoPath Dev

Use our Google Custom Search for best site search results.

to assign value to node

Last post 12-11-2008 01:46 AM by djibson. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 12-10-2008 04:50 PM

    to assign value to node

    i want to assign  value to node but  i ' 've  an exception: "The operation is not valid because the current state of the object."

    VB and Infopath 2007


    Dim sLibelle as String

    sLibelle = "EURO" 

    MainDataSource.CreateNavigator().SelectSingleNode("/my:mesChamps/my:NOM_MONNAIE", Me.NamespaceManager).SetValue(sLibelle)


    Please help! 


  • 12-10-2008 05:36 PM In reply to

    Re: to assign value to node

    What type of function is this code in?  You will not be able to change a node value in a Changing or Validating event.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 12-10-2008 09:20 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: to assign value to node


    Can you check once the below code first before setting the value to that node,

    //Check your node XPath should be correct

    Dim mONNAIENode = MainDataSource.CreateNavigator().SelectSingleNode("/my:mesChamps/my:NOM_MONNAIE", Me.NamespaceManager)

    If ‘mONNAIENode' node is not null then you can try to set the value,

    mONNAIENode.text = sLibelle

  • 12-11-2008 01:46 AM In reply to

    Re: to assign value to node

     Thanks Jimmy.

    before i used  Changing: it is not runing

    Now i use Changed: it is runing OK


    Thanks you very much   

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