G
Guest
Hi everybody
I have two sqls which are as
Set rst = CurrentDb.OpenRecordset("SELECT SUM(Closing) AS ClosingStock, BRD
AS Brand FROM " & txtTableName & " GROUP BY BRD")
above sql bringing correct record, 42 records with the grouping and suming
of closing Stock I tested in immediate winodw.
2nd sql is
Set rTarget = CurrentDb.OpenRecordset("SELECT * FROM tReportGenerating WHERE
Brand = ' " & rst!Brand & " ' ")
Do Until rst.EOF
rTarget.Edit
rTarget!ClosingStock = rst!ClosingStock
rTarget.Update
rst.MoveNext
Loop
rst.Close
rTarget.Close
Im getting error no. 3021
pls tell me where im doing wrong
thanks
I have two sqls which are as
Set rst = CurrentDb.OpenRecordset("SELECT SUM(Closing) AS ClosingStock, BRD
AS Brand FROM " & txtTableName & " GROUP BY BRD")
above sql bringing correct record, 42 records with the grouping and suming
of closing Stock I tested in immediate winodw.
2nd sql is
Set rTarget = CurrentDb.OpenRecordset("SELECT * FROM tReportGenerating WHERE
Brand = ' " & rst!Brand & " ' ")
Do Until rst.EOF
rTarget.Edit
rTarget!ClosingStock = rst!ClosingStock
rTarget.Update
rst.MoveNext
Loop
rst.Close
rTarget.Close
Im getting error no. 3021
pls tell me where im doing wrong
thanks