Solved

reports, calling from code.

Posted on 2016-10-26
3
58 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 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 36

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Familiarize people with the process of utilizing SQL Server views 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 Microsoft Access…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

713 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