Return Master/Detail field values and export to notepad via vbscript - InfoPath Dev
in

InfoPath Dev

Return Master/Detail field values and export to notepad via vbscript

Last post 05-04-2010 04:48 AM by Tommy. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 05-04-2010 04:48 AM

    • Tommy
    • Not Ranked
    • Joined on 05-04-2010
    • Posts 2

    Return Master/Detail field values and export to notepad via vbscript

    Hello, I'm not very good at coding and I need help creating a Master/Child form in VBScript in Infopath 2007. I want to create a form where the form grabs all data from a particular field and then export all the combined data to notepad

    Example Form:

    Receipt ID

                      Receipt Name

                      Receipt Item

                      Receipt Price

    BUTTON - Export all prices to notepad

    Once the data is on notepad, the prices from the fields are line by line
    2.99
    1.00
    3.99
    Etc...

    The code for my button at the moment:
    Sub ExportButton_OnClick(eventObj)

    'Write your code here
    ‘Declare variables
       Dim Oprice, price, fso
       Set Oprice= eventObj.Source.selectSingleNode("//my:Price")
       price = Oprice.Text

    ‘Write to notepad
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set NewsFile = fso.CreateTextFile("C:\PriceList.txt", True)
    NewsFile.WriteLine (price)
    NewsFile.Close
    End Sub

    It keeps exporting only the first price to notepad. How can I make it so that is can read all the prices that the users enters (the user can enter virtually unlimited data) and then put all that data into notepad line by line.

    I appreciate any help given

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