I'm getting puzzled on the code below , see if you can spot why this code fail to save data on the table sometimes in Ms Access and how should I do force it ensure all the received from Json is saved not left blank. Quite ok 99% of data received as a block is saved but sometime it return blank or empty , what could be the cause of this?
Code:
Set db = CurrentDb
Set Rs = db.OpenRecordset("ESDdReceipts", dbOpenDynaset)
Set json = JsonConverter.ParseJson(strDataAudit)
'Process data.
Z = 1
For Each Details In json
Rs.AddNew
Rs![ESDTime] = CDate(Format$(Details("ESDTime"), "00/00/00 00:00:00"))
Rs![TerminalID] = Details("TerminalID")
Rs![InvoiceCode] = Details("InvoiceCode")
Rs![InvoiceNumber] = Details("InvoiceNumber")
Rs![FiscalCode] = Details("FiscalCode")
Rs![SerialNumber] = Me.txtEsDFinInvoice
Rs.Update
Z = 1 + 1
Next
Rs.Close
Set Rs = Nothing
Set db = Nothing
Set json = Nothing
Set Details = Nothing