automate copy table and sequence table name

jalverson

Registered User.
Local time
Today, 15:43
Joined
Oct 27, 2004
Messages
42
I have a user who wants to automate copying a table from our main database. Basically, he is naming the new table with the original table name and the current date. For example, Part_Table_9-3-04, Part_Table_9-4-04, Part_Table_9-5-04 etc for each day of the month.

He wants me to write a macro, module, or vb code that automates the steps.

I have DoCmd.CopyObject,"Table1",AcTable,"Table2" I want to concatenate the date function (now) or (today) with the new table name but can't seem to get this to work.

Any suggestions?

Thanks for helping,

Jeff
 
dim newtableName as string

newTable = "Part_Table_" & format(Date(), "mm-dd-yy")

DoCmd.CopyObject,"Table1",AcTable, newTable


???
kh
 
Awesome, thanks for the response. I copied your code into the module that I was using and it works perfectly.

Thanks, again for the help.

Jeff
 
Just curious, you did correct the name thing, huh?

dim newtableName as string

newTable = "Part_Table_" & format(Date(), "mm-dd-yy")

DoCmd.CopyObject,"Table1",AcTable, newTable


???
kh
 

Users who are viewing this thread

Back
Top Bottom