صدف و ان رئيت هذا الكود في انترنت يمكن مبرمجي Visual Basic من فتح و طباعة تقارير Access
اعتقد بان Microsoft Access يجب ان يكون موجود ايضا في الجهاز
'----------------------------------------------------------------------
'Description
'This procedure prints or previews a report, and then closes the current
'instance of Microsoft Access (because objAccess is a procedure-level
'variable).
'Date 26/09/2001 AC
'Example PrintAccessReport dbname:= _
' "C:Program FilesMicrosoft OfficeOfficeSamplesNorthwind.mdb",
' rptname:="Sales by Category", preview:=True
'Called ....
'Master at www.ssw.com.au/ssw/kb/CodeBase
'----------------------------------------------------------------------
Sub PrintAccessReport(dbname As String, rptname As String, preview As Boolean)
Dim objAccess As Object
On Error GoTo PrintAccessReport_ErrHandler
Set objAccess = CreateObject("Access.Application")
With objAccess
.OpenCurrentDatabase filepath:=dbname
If preview Then 'Preview report on screen.
.Visible = True
.DoCmd.OpenReport reportname:=rptname, view:=Access.acPreview
Else 'Print report to printer.
.DoCmd.OpenReport reportname:=rptname, view:=Access.acNormal
DoEvents 'Allow report to be sent to printer.
else
Msgbox "Logic Error"
End If
End With
Set objAccess = Nothing
Exit Sub
PrintAccessReport_ErrHandler:
MsgBox Error$(), , "Print Access Report"
End Sub