K
Karen Middleton
I want to read a table ActStage which as the following fields -
Customer, Store, Fiscalyearperiod & Sales all fields except Sales are
text fields and Sales is a numeric field and sales can sometimes have
null values.
I want to loop through the recordset of ActStage table and I want to
update some fields in the current recordset based on some complex
business rules and similarly I want to delete the current record in
the recordset if some rules are met.
Please note I can do this in SQLServer T-SQL with what is called as a
updateable cursor. I want to do the same in VBA on the recordset
appreciate if you could share how it can be done. Please kindly share
the code for the same.
Thanks
Karen
Dim rstACTStage As DAO.Recordset
Dim strSql As String
Set rstACTStage = CurrentDb.OpenRecordset("select * from ACTStage")
Do While rstACTStage.EOF = False
' Want to update Sales field in the ActStage table here
' Want to delete a record in the recordset based on some
criteria
rstACTStage.MoveNext
Loop
rstACTStage.Close
Set rstACTStage = Nothing
Customer, Store, Fiscalyearperiod & Sales all fields except Sales are
text fields and Sales is a numeric field and sales can sometimes have
null values.
I want to loop through the recordset of ActStage table and I want to
update some fields in the current recordset based on some complex
business rules and similarly I want to delete the current record in
the recordset if some rules are met.
Please note I can do this in SQLServer T-SQL with what is called as a
updateable cursor. I want to do the same in VBA on the recordset
appreciate if you could share how it can be done. Please kindly share
the code for the same.
Thanks
Karen
Dim rstACTStage As DAO.Recordset
Dim strSql As String
Set rstACTStage = CurrentDb.OpenRecordset("select * from ACTStage")
Do While rstACTStage.EOF = False
' Want to update Sales field in the ActStage table here
' Want to delete a record in the recordset based on some
criteria
rstACTStage.MoveNext
Loop
rstACTStage.Close
Set rstACTStage = Nothing