Basically I want to execute every query within my database that exists in one of my tables. It should fill a recordset with the query names and loop through the database and execute each one.
When I try and run access keeps saying run-time error 3061 too few parameters (yellow line). I know the issues is with the sql, but not sure how to get around it or if this type of query is do-able.
My code below:
When I try and run access keeps saying run-time error 3061 too few parameters (yellow line). I know the issues is with the sql, but not sure how to get around it or if this type of query is do-able.
My code below:
Public Sub C38()
Dim rst As DAO.Recordset
Dim DB As Database
Set DB = CurrentDb()
Set rst = DB.OpenRecordset("mTable")
On Error Resume Next
Do While Not rst.EOF
'MsgBox rst!myQuery
DB.Execute rst!myQuery, dbFailOnError
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
End Sub
Last edited: