Ypi said:
I have a problem.
I need to make a macro that copies a table, renames it
and adds the current date into the tables name...
could someone give me any idea how to solve that problem?
thanks
It's easy enough to do, but on the face of it, it seems like a bad idea.
I can't think of a case in which it isn't a bad idea to incorporate
*data* into the name of an object. If you're going to have one table
just to hold data from, say, a particular date, and another table to
hold the same kind of data from another date, then it will be much
better to combine them into a single table with an additional field to
hold the date in question. That way, you don't have to create another
table each time you get data for another date, and you can process this
information with easy queries to extract the data for any given date.
Do you see what I'm getting at? And if you're doing this for archiving
purposes, why not just have a single archive table with a field for the
archive date, and use append queries to add data to that table, with the
archive date specified as a calculated field?
If you insist on doing what you originally asked, you can do it using
the TransferDatabase VBA method or macro action.