Action Query Row by Row

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there any way to loop thru an action query row by row?

eg

Dim rst As DAO.Recordset

Set rst = CurrentDb.OpenRecordset("my_action_query")

Do While Not rst.EOF
rst.MoveNext
Loop

Set rst = Nothing

Guess this is a common question, I don't want to use qdf.Execute as I want
to track the progress of the action query.
Thanks


Damien
 
It's depend what you are doing with this action query (update, append , delete)

Example of edit row by row, you need to open the table, not the action query
as the record source, and then run a loop and update each row

Dim rst As DAO.Recordset, MyDB as Dao.DataBase

MyDb = currentDb
Set rst = MyDb.OpenRecordset("Select * From TableName")

While Not rst.EOF
rst.edit
rst!FieldName = NewValue
rst.update
rst.MoveNext
Wend
 
Back
Top