Auto inserting of address in Table Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a make table query. This query is to make a back of the master table.
In the area where you name the new table it is called "backup of master"
But I want it to append the date the table was made in the table name. So
the new table name will be "backup of master 11/22/04". Is there some way
that I can do this?

Thanks Arend
 
I have a make table query. This query is to make a back of the master table.
In the area where you name the new table it is called "backup of master"
But I want it to append the date the table was made in the table name. So
the new table name will be "backup of master 11/22/04". Is there some way
that I can do this?

Thanks Arend

I'd STRONGLY suggest that you reconsider. Creating a new table in the
same .mdb file as the original is not a safe way to back up! The
typical way one risks losing data in Access is by the database
becoming corrupted; and when that happens you're likely to lose ALL of
the tables (your master and all your backups). Excessive make-table
queries will bloat your database and risk corruption all by
themselves.

Instead, back up the entire .mdb file, externally. Use the Windows
Explorer to copy the file to a folder with the date as the folder name
(manually of in a batch file). It'll be a lot safer.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
That is a good Idea. I would still like to know if the type of functionality
that I was trying to get to exists, as it could come in very hand in other
applications.
 
That is a good Idea. I would still like to know if the type of functionality
that I was trying to get to exists, as it could come in very hand in other
applications.

Well... it can be done. But a) MakeTable queries are almost NEVER
needed; and b) storing data in a table name (instead of in a table
field) is *always* a bad idea. I cannot think of a *good* reason to
want to do this.

Nevertheless, in order to do it, you would need to write VBA code to
either construct a DDL Create Table query, concatenating

Format(Date, "mmddyyyy")

into the SQL where the table name should be; or use the DAO
CreateTable method to create the table. There's no way to do it using
a parameter query.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 
Back
Top