Export ExcelWorkbook xlsx format

A

Aamer

Hi,
I have posted help on this subject earlier but maybe I was not very clear
about the problem I am facing or probably Its not possible at all (which I
hardly belive).

Anyways i will try to be more specfic about the problem.

1. I am useing Access 2007.
2. I have created a database where on the Switchboard I like to place a
Button.
3. Upon cliking the button I would like to save (Export) the following
tables (they should be saved by date) as everyday at the end of the day they
will be saved as backup in ExcelWorkbook xlsx format.
4. Tables Names are
a) Purchases
b) Sales
c) Customers
d) Sub Description

I have made a marco but the problem with this macro is its only saves the
Tables with the names where as no date is mentioned. As the next day when I
take the backup of the table by cliking that button it overwrites the
previous created file.

What I want is it should crate the file with the table name and the date of
backup so the older backup should not be overwitten.

I am stuck with this issue, help in needed.
I hope I have made my problem clear and understandable.

Please help me fix this issue.

Aamer





----------------
This post is a suggestion for Microsoft, and Microsoft responds to the
suggestions with the most votes. To vote for this suggestion, click the "I
Agree" button in the message pane. If you do not see the button, follow this
link to open the suggestion in the Microsoft Web-based Newsreader and then
click "I Agree" in the message pane.

http://www.microsoft.com/office/com...-81b0-d754169669c4&dg=microsoft.public.access
 
K

kc-mass

Try this it appends the date to the file name.

Regards

Kevin


Private Sub cbtReportsPlusExcel_Click()
Dim DB As Database
Set DB = CurrentDb
Dim strFileName As String
strFileName = Forms!frmTab!frmLoad!txtLoadedDirectory &
"AllOptionsData" _
& Month(Now()) & "_" & Day(Now()) & "_" & Year(Now()) & ".xlsx"
BuildINStringsAllIssuesPlus
DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8,
"qryAllIssuesInSuper", strFileName
Set DB = Nothing
End Sub
 

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