Solved

reports, calling from code.

Posted on 2016-10-26
3
66 Views
Last Modified: 2016-10-28
Can I call a Access report from external code? Like VB.NET?
0
Comment
Question by:HLRosenberger
[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
3 Comments
 
LVL 27

Accepted Solution

by:
MacroShadow earned 500 total points
ID: 41861090
Something along these lines:
Dim accessApp As Access.Application = CreateObject("Access.Application")
accessApp.OpenCurrentDatabase("path to your access file"", True)
accessApp.visible = True
accessApp.DoCmd.OpenReport("your report name", Access.AcView.acViewPreview)
accessApp.Quit()

Open in new window

0
 
LVL 38

Expert Comment

by:PatHartman
ID: 41861092
You would need to either use OLE automation or create a macro that prints the report and then closes the database.  You could then just shell out to run Access with the macro name as an argument.
0
 
LVL 1

Author Closing Comment

by:HLRosenberger
ID: 41863829
thanks.
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
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.
Suggested Courses

635 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