So far as I know, yes. But there may be an issue with some of the actions of the DoCmd that interfere with the query actions. With DeleteObject, CopyObject, Rename, and Close, a common theme may be that a file lock has been taken out on something that precludes the action in question.
So the question is, WHAT object are you trying to delete, copy, rename, or close? (That is a rhetorical question. You have the code in front of you, so you will have to answer that one for yourself.) If the object is open at the time and the lock is exclusive, you might not be able to do what you wanted.
There is hope (of sorts). In debug mode, you can see the local objects window and get some details about everything that is currently open. You might be able to find some locking status info that will help.
I'm a certified grandpa (3 times now) and proud of it.
Retired over one year and survived being home all day with the wife. She must really love me.
If I have helped you, please either click the thanks or click the scales.