"It doesn't work" is insufficient information. have you stepped through the code so you know that the delete is being executed? Are you getting an error message? Make sure that you don't have warning messages turned off. And as Doc suggested, if you have relationships, you need to delete tables from the "bottom" up.
In the real world, it is very rare indeed to delete a table on the fly. You might want to explain why you are doing this. We might be able to offer an alternative.
Working with temp tables causes database bloat unless you do it correctly. For example, in apps where I need to import sets of data from other applications where for whatever reason, I can't link to the remote tables, I keep all the temp tables in a separate template database. I make the template with empty tables, compact it and save it. Then when I need to import new data, I copy the template to the active directory which overlays any existing version. The name of the template didn't change so my table links are still intact. Then I just run append queries to fill the template.