Connecting Tech Pros Worldwide Forums | Help | Site Map

Date stamp on tables

alpha_male
Guest
 
Posts: n/a
#1: Nov 13 '05
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.

Be well,
Ivars

Wayne Morgan
Guest
 
Posts: n/a
#2: Nov 13 '05

re: Date stamp on tables


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]


Closed Thread


Similar Microsoft Access / VBA bytes