reports, calling from code.

Can I call a Access report from external code? Like VB.NET?
LVL 1
HLRosenbergerAsked:
Who is Participating?
 
MacroShadowConnect With a Mentor Commented:
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
 
PatHartmanCommented:
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
 
HLRosenbergerAuthor Commented:
thanks.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.