Hallo Experts
I have a challenge here I want to update an existing document in MS access with extra important information from some other table by criteria (example with WHERE CLAUSE) for example If I want to use a simple method then it will be like below:
But this method is very slow against SQL Server while using the method below is faster, but how do I put the criteria so the data goes to update only a particular document line, for example if a document has 6 fields like below meaning only those field with the correct reference number must be updated.
Here is working VBA code, the data is coming from the internet server:
I have a challenge here I want to update an existing document in MS access with extra important information from some other table by criteria (example with WHERE CLAUSE) for example If I want to use a simple method then it will be like below:
Code:
UPDATE tblJournalHeader INNER JOIN tblVoucher ON tblJournalHeader.CreateID = tblVoucher.CreateID SET tblJournalHeader.Status = [Forms]![FrmJournalVourcherPosting]![CboStatus], tblVoucher.Authority = [Forms]![FrmJournalVourcherPosting]![CboStatus]
WHERE (((tblJournalHeader.CreateID)=[Forms]![FrmJournalVourcherPosting]![CboCreateID]));
But this method is very slow against SQL Server while using the method below is faster, but how do I put the criteria so the data goes to update only a particular document line, for example if a document has 6 fields like below meaning only those field with the correct reference number must be updated.
Here is working VBA code, the data is coming from the internet server:
Code:
Set db = CurrentDb
Set rs = db.OpenRecordset("ViewtblESDPOS", dbOpenDynaset, dbSeeChanges)
Set json = JsonConverter.ParseJson(strDataAudit)
'Process data.
Z = 1
For Each Details In json
rs.AddNew
rs![ESDTime] = Details("ESDTime")
rs![TerminalID] = Details("TerminalID")
rs![InvoiceCode] = Details("InvoiceCode")
rs![InvoiceNumber] = Details("InvoiceNumber")
rs![FiscalCode] = Details("FiscalCode")
rs![INVID] = CLng(Me.txtdataESDTransfers)
rs.Update
Z = Z + 1
Next
rs.Close
Set rs = Nothing
Set db = Nothing
Set json = Nothing
Set Details = Nothing
Last edited: