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

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

Posted on 2014-12-10
4
163 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
  • 2
4 Comments
 
LVL 50

Assisted Solution

by:Rgonzo1971
Rgonzo1971 earned 200 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 300 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

809 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