rename or copyobject with user-defined name?

R

R

I want to allow my user to define a new name for a copied or renamed table -
the process is run from a macro. I see that the new name is a required
argument.

Is there any way to set a variable in the new name so I can prompt the user
for a name? Ideally the name would always be "RAD" & [date], so even if I
could get the date in the new name withOUT prompting the user would be
wonderful.

Thoughts?
 
C

chas

Hi,

the following piece of VBA code will do what you need:

DoCmd.CopyObject , "RAD" & Date(),
acTable, "OriginalTableName"

It will copy the table (OriginalTableName) into a new
table called RAD followed by todays date. If you want to
include the time use Now() instead of Date().

hth

chas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top