Rename table and export

B

Boss

Hi,

I am preparing a databse (MIS) which keeps details of work done of about 150
employees.
Idea is that i import lot of data from excel and other systems into the
database and daily i generate a "daily final report".

Point i am stuck is:- I am unable to rename table using today() command. But
I can rename it using now() command.

Could somebody help me with two things.

First: A code which renames my final report (MS access table) named as
"final" with today's date. The report table s daily named as "final". so the
code should directly go and rename "final" table into date.

Second: A code which can export all the tables into one excel sheet, with
each table in one worksheet. Please do not advise tradnsferspreadsheet
function because i wish to prepare a monthly report with details of all the
30 days. Each spreadsheet being one day in excel.

Any help us deelpy respected. This community has helped me in each and every
small or big project. I have learned a lot from this forum. Hats off to all.

Thanks!
Boss
 
P

pietlinden

Hi,

I am preparing a databse (MIS) which keeps details of work done of about 150
employees.
Idea is that i import lot of data from excel and other systems into the
database and daily i generate a "daily final report".

Point i am stuck is:- I am unable to rename table using today() command. But
I can rename it using now() command.

Could somebody help me with two things.

First: A code which renames my final report (MS access table) named as
"final" with today's date. The report table s daily named as "final". so the
code should directly go and rename "final" table into date.

Second: A code which can export all the tables into one excel sheet, with
each table in one worksheet. Please do not advise tradnsferspreadsheet
function because i wish to prepare a monthly report with details of all the
30 days. Each spreadsheet being one day in excel.

Any help us deelpy respected. This community has helped me in each and every
small or big project. I have learned a lot from this forum. Hats off to all.

Thanks!
Boss

First: Today() is an Excel function, not an Access function. Date()
is the corresponding function in Access VBA. If you want a timestamp,
use Now(). Renaming... use DoCmd.Rename ... if you absolutely must.
I would not do that, because it will screw up any code you have that
depends on that table's name remaining constant. If you want to take
a portion of the records in the table and do something with them, you
could index the table on your search fields to speed things up and
then use a query to get the records you want.

Second: If you want to dump them to Excel, you could use
CopyFromRecordset.
 
B

Boss

Thankyou so much for the =date() function.

Could you please help me more on the CopyFromRecordset function.

Thanks!
 

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