Sorry, the double quotes would be how the equivalent of how to assign stSQL like that from vba.
I would suggest writing your textfile like this
UPDATE Organisation
SET Org_Ref = '
VAR usrformtextbox1
', Org_Name = '
VAR usrformtextbox2
', Contact_Lastname = '
VAR usrformtextbox3
', Contact_Firstname = '
VAR usrformtextbox4
', Org_Contact_Email = '
VAR usrformtextbox5
', Org_Contact_Tel = 'u
VAR srformtextbox6
' WHERE Org_ID = prikey
Then your code would be
Sub macro_1()
Dim fs, txtfile, stSQL, str
Set fs = CreateObject("scripting.filesystemobject")
Set txtfile = fs.opentextfile("E:\test.txt")
Do Until txtfile.atendofstream
str = txtfile.readline
If Left(str, 3) = "VAR" Then
stSQL = stSQL & CallByName(Split(str, " ")(1), ".value", VbGet)
Else
stSQL = stSQL & str
End If
Loop
End Sub
Bookmarks