Date stamp on tables
Thank you, Wayne, for your answer. That was exactly what I needed.
There was tiny mistake strSQL statement (Table1.* should be tblHello.*
).
To answer your question why I need this. I have table in accounting
program and in order to track changes in the VAT, I have made queries
which would track these changes. I had to only indicate which
tables(they have the same structure) I need to compare. After each
month I am planning to run your code in order to solidify the tables
from linked tables from accounting programm.
Ivars
You could run a Make Table query.
strSQL = "SELECT Table1.* INTO tblHello" & Format(Date, "ddmmyy") & "
FROM
tblHello;"
CurrentDb.Execute strSQL, dbFailOnError
For sorting purposes, you may prefer "yymmdd". This will sort these
tables
chronologically in the database window. Since you said this would be
run on
the 31st, I used the Date function. You could also specify a
particular date
if you wished. This will also include the data from the linked table.
Now, for the real question. Why are you doing this? If you're just
wanting
to segregate items performed during certain months, then it would be
better
to have a date field in each record that tells you what date it was
performed and use a query to limit your results to the desired date or
date
range.
--
Wayne Morgan
MS Access MVP
"alpha_male" <alpha_male@inbox.lv> wrote in message
news:64a041a4.0412130531.1ff5fe09@posting.google.c om...[color=blue]
> Can anybody help to create code which would
> create new table from linked table and additionally will add date
> stamp for the name of new table? For example tblHello is linked table
> and the code would create a table tblHello311204 at the 31st december
> of 2004.[/color] |