Dim cn As ADODB.Connection
Dim catDB As ADOX.Catalog
Dim cmd As ADODB.Command
Dim sQueryName As String
Dim sSQL As String
Set cn = CurrentProject.Connection
Set catDB = New ADOX.Catalog
catDB.ActiveConnection = cn
sQueryName = "MyQuery"
sSQL = "SELECT ID FROM Customers"
Set cmd = New ADODB.Command
Set cmd = catDB.Procedures(sQueryName).Command
cmd.CommandText = sSQL
Set catDB.Procedures(sQueryName).Command = cmd
Set catDB = Nothing
cn.Close