Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Control Button to Export Access Tables to Excel Database with Multiple Sheets (overwrite data in Excel; do not create new sheets)

Posted on 2013-12-23
6
1,271 Views
Last Modified: 2013-12-27
NEW!  MS Access 2013:  I have a database with 6 tables.  It would be very useful to me if I could get a code that, upon the click of a Form’s Control Button, would automatically export each of these tables to an MS Excel Spreadsheet (each Table is placed into a separate, same name sheet).  

It is very important, though, that the exported data always goes to the same Spreadsheet with the same Sheets (they have already been created)—and simply over-writes any data that may already exist in the Excel Sheets.  This is because there is another Excel Spreadsheet that has formula’s attached to each sheet within this one).

Attached is my Excel Spreadsheet along with my Access Database.  The 6 tables I would like export are:

InputT1
InputT2
SentenceOptionT1
SentenceOptionT2
NotesT1
NotesT2

The Excel Spreadsheet (Path) is:  
C:\Users\Matt\Desktop\Access Table Dump.xlsx

Can anyone help with this one?
Final-WUCAINS.accdb
Access-Table-Dump.xlsx
0
Comment
Question by:mdstalla
6 Comments
 
LVL 35

Expert Comment

by:PatHartman
ID: 39737336
Use TransferSpreadsheet to export the data.  Reference the same file name for all 6 exports and use a query name that matches a sheet name to target a specific sheet.  So use a query named InputT1 to export the data you want to export to the sheet named InputT1.  Query InputT2 will export to sheet InputT2, etc.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 39737337
test this, place both the db and the excel file in the same folder

click on the Button Export 2 XL
Final-WUCAINS-rev.accdb
0
 
LVL 35

Expert Comment

by:[ fanpages ]
ID: 39737715
0
 

Author Comment

by:mdstalla
ID: 39738042
I've requested that this question be deleted for the following reason:

Created a better defined queston.
0
 
LVL 30

Accepted Solution

by:
hnasr earned 500 total points
ID: 39738815
Try: using D:\xl.xlsx file

Steps
Export  table to workbook as Sheet TableTemp
Copy Sheet TableTemp
Paste to Sheet Table
Delete Sheet TableTemp.
Final-WUCAINS-2.accdb
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question