Hi,
Does anyone know if it is possible to print an already made MS Access report from VB? If so, does it require you to have MS Access installed on your machine?
Thanks.
Printable View
Hi,
Does anyone know if it is possible to print an already made MS Access report from VB? If so, does it require you to have MS Access installed on your machine?
Thanks.
Hi
Follow this URL to c what u want
http://www.codeguru.net/bbs/wt/showp...&sb=5#Post5367
Yes MS Access should me loaded
Good Luck Praba
Is this URL still valid? I tried accessing it and got a not found error. Can you repost the answer to the question? I would like to print an Access report from a VB program. Thanks.
Mel Lamelas
Hi,
U need Acces97 installed.
Create mdb biblio97.mdb (biblio.mdb will be in ur harddisk)
Create a sample report, name it as "report1"
create vb project.
add a new form. Add command button in this form.
Copy the code given below in the module area of the form. Change path if required for Mdb.
run the project , click the button, "report1" will be printed.
Regards
Praba
Option Explicit
Private Sub Command1_Click()
Dim objAcc As New access.Application
Set objAcc = CreateObject("C:\BIBLIO97.MDB")
objAcc.DoCmd.OpenReport "report1", acNormal
objAcc.CloseCurrentDatabase
objAcc.Quit
Set objAcc = Nothing
End Sub
And if I need the preview?? I tried with the acpreview option, but it doesn't work... why??
use acpreview parameter for OpenReport Method
After this statement put some wait state. u can use API Sleep funnction for this
Example, please...