Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to pass records from MS Access to an MS Excel template

Posted on 2014-12-10
4
Medium Priority
?
168 Views
Last Modified: 2014-12-14
I am familiar with how to establish a MS Excel session within MS Access and manipulate records within MS Excel from MS Access  However, if I need to take a 1000 records from an MS Acccess table (75 columns) and put that information into an MS Excel template file what is the most efficient way of accomplishing this task.  Any links or example would be great.

I assume I would want to loop thru my table and work on a record at a time keeping track of what row I am on within MS Excel...

Note I can not do a docmd since the purpose of the MS Excel template is to avoid any formatting I may need to do once the data is within MS Excel.  However, I am wondering if I am better off doing a docmd and getting the data out into the workbook and then attempting the formatting from within MS Access
0
Comment
Question by:upobDaPlaya
[X]
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
  • 2
4 Comments
 
LVL 53

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 800 total points
ID: 40493197
Hi,

Instead of DoCmd you could Use within Excel CopyRecordSet

http://msdn.microsoft.com/en-us/library/office/ff839240(v=office.15).aspx

Regards
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40493607
is "MS Excel template" really a template (.xlt, .xltx)  or just a preformatted Excel workbook?
0
 

Author Comment

by:upobDaPlaya
ID: 40493949
I have attached a sample of what I am trying to do.  I have an MS Access DB that has 2 tables.  Each table will be placed in its own MS Excel worksheet, but the same workbook.  Note the Excel workbook has formatting in addition to formulas I need to display (row 11 Profile worksheet and row 6 Hours worksheet).

The Hours tab is somewhat standard in I assume I will write the data from the MS Access Hours table to the Hours worksheet, although I am struggling with how I would display the formulas.  In addition the Hours tab currently has 6 rows, but the amount of row I will try to write from the MS Access Hours table will not always be 6 rows.

The Profile tab is a little trickier since some cells are only populated once and it is not a 1 to 1 drop from the MS Access table.

Lastly I am creating a workbook for each Profile ID.  I am looping thru to get each Profile ID so that is not an issue.
eeExcel.xlsx
eeMSAccess.accdb
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 1200 total points
ID: 40496386
place this in the same folder as your excel file, then run Export2XL in module 1
eeMSAccess.accdb
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

609 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