W
Wahab
Hi everybody,
I writing following recordset, but everytime I'm getting error, actually not
working
can some one tell me pleaz whats wrong with this. Pleaz help me to fix this.
Dim StrSQL as String
StrSQL= " SELECT D.InvoiceNo, D.ProductID, D.ItemPrice, D.SaleAmount," & _
" D.SaleCopAmount FROM tCoptInvoices" & _
" INNER JOIN tCoptInvoicesDetails D ON tCoptInvoices.InvoiceNo =
D.InvoiceNo " & _
" WHERE Date Between # " & BeginningDate & " # And # " &
EndingDate & " # "
Set rst = CurrentDb.OpenRecordset(StrSQL)
Set rTarget = CurrentDb.OpenRecordset("tInvoicesDetails")
Do Until rst.EOF
rTarget.AddNew
rTarget!InvoiceNo = rst!InvoiceNo: rTarget!ProductID =
rst!ProductID
rTarget!Cartons = rst!Cartons: rTarget!ItemPrice =
rst!ItemPrice
rTarget!SaleAmount = rst!SaleAmount
rTarget.Update
rst.MoveNext
Loop
rst.Close
I writing following recordset, but everytime I'm getting error, actually not
working
can some one tell me pleaz whats wrong with this. Pleaz help me to fix this.
Dim StrSQL as String
StrSQL= " SELECT D.InvoiceNo, D.ProductID, D.ItemPrice, D.SaleAmount," & _
" D.SaleCopAmount FROM tCoptInvoices" & _
" INNER JOIN tCoptInvoicesDetails D ON tCoptInvoices.InvoiceNo =
D.InvoiceNo " & _
" WHERE Date Between # " & BeginningDate & " # And # " &
EndingDate & " # "
Set rst = CurrentDb.OpenRecordset(StrSQL)
Set rTarget = CurrentDb.OpenRecordset("tInvoicesDetails")
Do Until rst.EOF
rTarget.AddNew
rTarget!InvoiceNo = rst!InvoiceNo: rTarget!ProductID =
rst!ProductID
rTarget!Cartons = rst!Cartons: rTarget!ItemPrice =
rst!ItemPrice
rTarget!SaleAmount = rst!SaleAmount
rTarget.Update
rst.MoveNext
Loop
rst.Close