Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

reports, calling from code.

Posted on 2016-10-26
3
Medium Priority
?
71 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 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 39

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

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

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.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

722 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