Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I be prompted for to name o copied table

Status
Not open for further replies.

ooch1

MIS
Nov 4, 2003
190
GB
Hello,

I have been looking into creating an archive db that copies and ouputs the table into a new dataase.

What i would like to happen is to be prompted to re-name the table so i can manually date stamp it.

Does anyone know of any quick ways of doing this, as the copyobject and renaming functions either sets the new name as specified, or keeps the original one. Neither of these 2 combinations fulfill my requirements.

OOch
 
ooch1

Code:
DoCmd.CopyObject destinationdatabase, InputBox("Enter name", "Copied Table Name"), acTable, strOldTableName

Or if you want an auto timestamp
Code:
DoCmd.CopyObject destinationdatabase, "Copied" & format(Date, "yyymmdd_hhmm"), acTable, strOldTableName
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top