Hi,
i have designed reports with access.I need code to call them in vb so that i can print them via an application am developing.Anyone know how to do so?Thanx

Hi, you can through this code to be printed report from the file Access:

'Add 1 Command Button to your form.
'Add 1 reference to Microsoft Access X.0
'Object Library (( From
'VB Menu choose Project -> References...,
'mark the Microsoft Access X.0
'Object Library check box and press OK )).

'Form Code
Private Sub Command1_Click()
    Dim ac As Access.Application
    Set ac = New Access.Application
    ' open the database.
    ' replace the "c:\myDir\myDBFileName.mdb" below with your
    ' database file name
    ac.OpenCurrentDatabase ("c:\myDir\myDBFileName.mdb")
    ' uncomment the line below if you want to see Print Preview
    ' ac.Visible = True
    ' replace the acViewNormal below with acViewPreview
    ' if you want to see Print Preview
    ac.DoCmd.OpenReport "Catalog", acViewNormal
    ' delete the line below if you want to see Print Preview
    ac.CloseCurrentDatabase
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.