G
Guest
Hi everybody
In my DB I have one table stockMaster table with fields Brand as text field
and closingStock as number field. Another table tSstockReport table with
only certain Brand ont complete list of brands, In this table I want write
brand's closingstock from table StockMaster, due to unequal records, records
set not work How I will tackle this my recordset is like this:
Set rst = CurrentDb.OpenRecordset("SELECT SUM(Closing) AS ClosingStock,
Brand FROM StockMaster GROUP BY BRD")
Set rTarget = CurrentDb.OpenRecordset("SELECT Brand, ClosingStock FROM
tSstockReport WHERE Brand = '" & rst!Brand & "' ")
If Not rTarget.EOF Then
rTarget.Edit
rTarget!closingstock = rst!closingstock
rTarget.Update
rst.MoveNext
Loop
rst.Close
rTarget.Close
End Sub
Please rectify the above so I can find tthe first records from tSstockReport
and get its ClosingStock Value from StockMater Table.
Thnaks in advance.
In my DB I have one table stockMaster table with fields Brand as text field
and closingStock as number field. Another table tSstockReport table with
only certain Brand ont complete list of brands, In this table I want write
brand's closingstock from table StockMaster, due to unequal records, records
set not work How I will tackle this my recordset is like this:
Set rst = CurrentDb.OpenRecordset("SELECT SUM(Closing) AS ClosingStock,
Brand FROM StockMaster GROUP BY BRD")
Set rTarget = CurrentDb.OpenRecordset("SELECT Brand, ClosingStock FROM
tSstockReport WHERE Brand = '" & rst!Brand & "' ")
If Not rTarget.EOF Then
rTarget.Edit
rTarget!closingstock = rst!closingstock
rTarget.Update
rst.MoveNext
Loop
rst.Close
rTarget.Close
End Sub
Please rectify the above so I can find tthe first records from tSstockReport
and get its ClosingStock Value from StockMater Table.
Thnaks in advance.