5 Replies Latest reply: May 20, 2014 10:06 AM by Antoine Frangieh RSS

    Updating field from Inputfield

      Hello guys,


      Would you please help me with this.


      I have a table with 3 fields


           Comments     inputfield

           _Comment2     this field is used in a pivot table because I can not use the inputfield to group the rows.


      I want to change the value of the inputfield  and update the _Comment2 field for the current Order_No.


      I've been trying with some lines with out success.


           ActiveDocument.DynamicUpdateCommand("Update MyTable SET _Comment2 = Comments Where Order_No='1'")

      but not working.



      Declaring variable into settings as sMyVar and the default value with =Comments, and on the trigger section I added Set Variable for the Comment field OnChange action like, Variable sMyVar and Value =Comments.


      In a macro code:

           set vValor = ActiveDocument.Variables("sMyVar")

           MsgBox ( vValor.GetContent.String)     '(here i get an error "Object required vValor" and stops macro)

           ActiveDocument.DynamicUpdateCommand("Update MyTable SET _Comment2 = '"&vValor&" Where Order_No='1'")



      I'll appreciate all kind of help about this issue.