Hey there all!

I have a stored query which is created using ADOX - My problem is I want to create a UPDATE query based on the stored query... Does anyone know how to achieve this?

I tried creating the UPDATE query with the following code :

Code:
--------------------------------------------------------------------------------

Sub UpdateQuery(strDBPath As String, _
strQryName As String, _
strSQL As String)

Dim catDB As ADOX.Catalog
Dim cmd As ADODB.Command

Set catDB = New ADOX.Catalog

' Open the Catalog object.
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" &_
"Data Source=" & strDBPath

Set cmd = New ADODB.Command

' Get the query from the Procedures collection.
Set cmd = catDB.Procedures(strQryName).Command

' Change the query's SQL statement.
cmd.CommandText = strSQL

'Save the updated query.
Set catDB.Procedures(strQryName).Command = cmd
Set catDB = Nothing

End Sub
--------------------------------------------------------------------------------


Then I used

Code:
--------------------------------------------------------------------------------

UpdateQuery "k:\division\marcom\td agency\access projects\crumbs.mdb", _
"Employees by Region", "PARAMETERS prmRegion Text;" _
& "UPDATE qryTop SET [qryTop].User = '" & Forms!frmAllocate!cboUsers & "';"
--------------------------------------------------------------------------------
to excecute it... But that just kept giving me an error the the oject could not be found in the collection???
any ideas?

Thanx a million