access report in excel

Posted on 2011-10-12
Medium Priority
Last Modified: 2012-05-12
I import data from odbc into excel. I want to start the access report from a macro button in excel. Is this possible? Without access itself being started..

Im using microsoft query to always keep the data in my excel sheet updated. But I need to show this data like a concatenated list, like you can do with reports in access.

Or, if theres a way of grouping and showing the data like a report in excel I guess that would be the best.?
Question by:bergsprekken
  • 2
LVL 19

Expert Comment

by:Arno Koster
ID: 36955463
Yes, this is certainly possible.

Easiest way to accomplish this is to go to the developer tab and start recording a macro. Then manually perform an update query and stop recording. You can then find the recorded macro code by opening the VBA code editor and looking in the modules section of the spreadsheet.

In the spreadsheet itself you can add an Active-X button (click on developers tab - insert - activex - button, draw the button on the worksheet). Double-click on the button to generate the appropriate event handler and fill in the name of the recorded macro.

Expert Comment

ID: 36955509

Author Comment

ID: 36955555
What I meant to ask was how to start a access report from excel and use the data in excel.
LVL 19

Accepted Solution

Arno Koster earned 2000 total points
ID: 36967644
in general that would be something like

Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase "c:\path_to\database.mdb"
appAccess.DoCmd.OpenQuery "Query Name"

Open in new window


Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

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

We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In a use case, a user needs to close an opened report by simply pressing the Escape (Esc) key. This can be done by adding macro code in Report_KeyPress or Report_KeyDown event.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

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