Here is my problem in Ms Access VBA Code , the code which is supposed to write to the serial port is not fed with data as a result it cannot write anything to the port, below is the actual peice of code that require fixing:
VBA CODE 1
' Write data to serial port.
strData = JsonConverter.ConvertToJson(transaction, Whitespace:=3) & Chr$(13)
lngStatus = CommWrite(intPortID, strData)
lngSize = Len(strData)
If lngStatus <> lngSize Then
MsgBox "No data found"
' Handle error.
If I send the same data to a text file , I'm able to see the actual Json data in text form by using the CODE below:
VBA CODE 2
Dim json As String
Dim theFileName As Variant
json = JsonConverter.ConvertToJson(transaction, Whitespace:=3) & Chr$(13)
theFileName = "C:\Users\admini\Desktop\Leaders\VBA Json.txt"
Dim handle As Integer
handle = FreeFile
Open theFileName For Output As #handle
Print #handle, json 'jsonSerialization
See also screen shoot which confirms that there is no data at all written the port: