If you are trying to do this on the open database this will error because the database has to be closed. When you do this from the command/ribbon, the Program closes the file and does its magic. When you try to do this from VBA, the file closes, and then the Program forgets what it was doing...
The only ways I can see that you could potentially do this is to start another instance of the Access application that had code to check that the calling application has closed, then you could potentially call the C&R or maybe shell out run a script.
You really should not need to C&R a live database if it is properly designed. If you are importing and deleting a lot of data, then I would suggest that you split the database out. You can then then do some magic with that backend database file.
(you'll find one discussion about this here:
http://bytes.com/topic/access/answer...base-using-vba as you can see it's not something that is easily done)