Very close to a straight cut and paste job, but here is the code I'm using :
CODE
Dim intELT_ID As Integer
intELT_ID = Me.ELT_ID
Dim cat As New ADOX.Catalog
Dim cmd As ADODB.Command
Dim rs As ADODB.Recordset
cat.ActiveConnection = CurrentProject.Connection
Set cmd = cat.Procedures("qryDuplicate_ELT").Command
If Not (cmd Is Nothing) Then
cmd.Parameters("ELT").Value = intELT_ID
Set rs = cmd.Execute
rs.Close
End If
Set cmd = Nothing
When I try run it, it runs to the rs.close line and I get error 3704. Operation not allowed when object is closed. If I just comment it out, it works fine. I want to know however why is this so ? will it affect me negatively some time in the future if I just comment it out ?