something like:
Code:
Public Sub ExportJson()
Dim vQry, vFile
Dim rst
Const Q = """"
vFile = "c:\Json.txt"
vQry = "qsMyQuery"
Open vFile For Output As #1
Print #1, "{"
Set rst = currentdb.openrecordset(vQry)
With rst
While Not .EOF
Debug.Print Q & "Customer:" & Q & .fields("Customer").Value
Debug.Print Q & "TaxID:" & Q & .fields("TaxID").Value
Debug.Print Q & "Address:" & Q & .fields("Address").Value
Debug.Print Q & "InvoiceDate:" & Q & .fields("InvoiceDate").Value
Debug.Print Q & "Items:["
Debug.Print Q & "ItemId:" & Q & .fields("ItemId").Value
Debug.Print Q & "Product:" & Q & .fields("Product").Value
Debug.Print Q & "Qty:" & Q & .fields("Qty").Value
Debug.Print Q & "UnitPrice:" & Q & .fields("UnitPrice").Value
Debug.Print Q & "TotalPrice:" & Q & .fields("TotalPrice").Value
.movenext 'goto next record
Wend
End With
Print #1, "]"
Print #1, "{"
Print #1, "["
Print #1, Q & "T" & Q & ":" & Q & "T" & Q
Print #1, Q & "B" & Q & ":" & Q & "B" & Q
Print #1, "]"
Print #1, "}"
Print #1, "}"
Close 1
Set rst = Nothing
End Sub