Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

reports, calling from code.

Posted on 2016-10-26
3
Medium Priority
?
75 Views
Last Modified: 2016-10-28
Can I call a Access report from external code? Like VB.NET?
0
Comment
Question by:HLRosenberger
3 Comments
 
LVL 28

Accepted Solution

by:
MacroShadow earned 2000 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 40

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

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…
Windows Explorer lets you open cabinet (cab) files like any other folder. In VBA you can easily handle normal files and folders, but opening and indeed creating cabinet files takes a lot more - and that's you'll find here.
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.
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. …
Suggested Courses

886 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