Append today's date to the name of the table

  • Thread starter Thread starter Irina
  • Start date Start date
I

Irina

I have a macro that runs CopyObject command
to copy one table from the database into another access table.
I want to add a current date to the name of the table in the
new database when the macro runs. Is there a way to add a date
at the end of the table name?
for example. instead of objectName tblClient
I want to do something like this

tblClient&" "&Date() so it copies the table as tblClient 05-02-2008
thanks to anyone who can help me with this
 
I do not know if it will work but it would need to be like this ---
tblClient&" "&Format(Date(), "mm-dd-yyyy")
 
Irina,

I think Karl's idea will work, except you would put a = in front, and
also spaces around the &s like this:
="tblClient " & Format(Date(),"mm-dd-yyyy")

Having said that, I would caution that this sounds like a very
suspicious idea, if you don't mind me saying so. I would really suggest
you get some further advice on creating tables based on divisions of data.
 
Steve -
the reason why I wanted to export the table as a copy with a date
into another DB is for backup purposes in case something gets screwed up
in the actual db. But instead what I can do is do a backup of the actual
database.
I think... I am not sure if I have to do this using task scheduler or what.
what do you think?
 
Back
Top