G
Guest
Hi
Im writing RS on Query to update records to new table but it gives me error,
can some one help me to write this recrod set pls.
dim db as DAO.Database
dim rst as DAO.Recordset
dim rTarget as DAO.Recordset
Set rst = CurrentDb.OpenRecordset("QryCustCurrTransactions",dbOpenDynaset)
Set rTarget = CurrentDb.OpenRecordset("LocalTB", dbOpenDynaset)
Do Until rst.EOF
rTarget.AddNew
rTarget!TrnDate = DateSerial(Year(rst!TrnDate),
Month(rst!TrnDate) + 1, 1 - 1)
rTarget!CustomerID = rst!CustomerID
rTarget!Debit = rst!DrKD
rTarget!Credit = rst!CrKD
rTarget.Update
rst.MoveNext
Loop
rst.Close
rTarget.Close
Thanks in advance
Im writing RS on Query to update records to new table but it gives me error,
can some one help me to write this recrod set pls.
dim db as DAO.Database
dim rst as DAO.Recordset
dim rTarget as DAO.Recordset
Set rst = CurrentDb.OpenRecordset("QryCustCurrTransactions",dbOpenDynaset)
Set rTarget = CurrentDb.OpenRecordset("LocalTB", dbOpenDynaset)
Do Until rst.EOF
rTarget.AddNew
rTarget!TrnDate = DateSerial(Year(rst!TrnDate),
Month(rst!TrnDate) + 1, 1 - 1)
rTarget!CustomerID = rst!CustomerID
rTarget!Debit = rst!DrKD
rTarget!Credit = rst!CrKD
rTarget.Update
rst.MoveNext
Loop
rst.Close
rTarget.Close
Thanks in advance