Mondrigore
Programmer
I have used code similar to the following:
Public Const acPreview = 2
Public Const acNormal = 0
Public Sub RunReport(Subject As String, Optional Preview As Variant)
Dim Access As Object
If IsMissing(Preview) Then Preview = False
Set Access = CreateObject("Access.Application"
With Access
.OpenCurrentDatabase filepath:=DB_NAME
If Preview Then 'preview report on screen
.Visible = True
.DoCmd.OpenReport Subject, acPreview
Else 'print report to printer
.DoCmd.OpenReport Subject, acNormal
DoEvents 'allow report to be sent to printer
End If
End With
Set Access = Nothing
End Sub
This allows me to print a report created in Access from my vb program and it works fine on a PC with Access installed on it. The problem I have is that if I install my program on a PC WITHOUT MS Access I get run-time error 429. What do I need to do to allow non-Access PC's the ability to print these reports? I have Office 97 Developer.
Public Const acPreview = 2
Public Const acNormal = 0
Public Sub RunReport(Subject As String, Optional Preview As Variant)
Dim Access As Object
If IsMissing(Preview) Then Preview = False
Set Access = CreateObject("Access.Application"
With Access
.OpenCurrentDatabase filepath:=DB_NAME
If Preview Then 'preview report on screen
.Visible = True
.DoCmd.OpenReport Subject, acPreview
Else 'print report to printer
.DoCmd.OpenReport Subject, acNormal
DoEvents 'allow report to be sent to printer
End If
End With
Set Access = Nothing
End Sub
This allows me to print a report created in Access from my vb program and it works fine on a PC with Access installed on it. The problem I have is that if I install my program on a PC WITHOUT MS Access I get run-time error 429. What do I need to do to allow non-Access PC's the ability to print these reports? I have Office 97 Developer.