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