Reshmi mohankumar
Registered User.
- Local time
- Today, 07:31
- Joined
- Dec 5, 2017
- Messages
- 101
Dim dayend, stock, upd As String
dayend = "insert into tbl_dayend(dayend,dayenddate) values ('1','" & txtnxtdt & "')"
stock = "INSERT INTO Tbl_stonestockopening (stonesubgroup, stonename, size, closinpcs, closingweightcts)" _
& "select stonesubgroup, stonename, size, clspcs, clswt from qry_stock_byname3"
upd = " update tbl_stonestockopening set transactiondate='" & txtdate & "',fy='" & txtfy & "',openingdate='" & txtdate + 1 & "'" _
& "where transactiondate is null"
DoCmd.RunSQL stock
DoCmd.RunSQL upd
DoCmd.RunSQL dayend
here "qry_stock_byname3" is a nested query
dayend = "insert into tbl_dayend(dayend,dayenddate) values ('1','" & txtnxtdt & "')"
stock = "INSERT INTO Tbl_stonestockopening (stonesubgroup, stonename, size, closinpcs, closingweightcts)" _
& "select stonesubgroup, stonename, size, clspcs, clswt from qry_stock_byname3"
upd = " update tbl_stonestockopening set transactiondate='" & txtdate & "',fy='" & txtfy & "',openingdate='" & txtdate + 1 & "'" _
& "where transactiondate is null"
DoCmd.RunSQL stock
DoCmd.RunSQL upd
DoCmd.RunSQL dayend
here "qry_stock_byname3" is a nested query