Printing Access Report from VB Program

R

Robyn

Does anyone have a vb program written to print an access
report without the person being able to open the database
in access? Thanks
 
S

SA

Robyn:

To print an Access report, Access (full or run time) must be launched as
there is no other app that can instantiate and print an Access report.

You can however do it from automation quite easily as in:

Dim objAcc as Object
Set objAcc = CreateObject("Access.Application")
With objAcc
.OpenCurrentDatabase("PathToTargetDb")
.DoCmd.OpenReport "YourReport"
DoEvents
.Quit
End with
Set objAcc=Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top