How to Open Access Reports in Visual Basic 6.0 by hamzajhang



Read and add posts to the Visual Basic 6.0 Forums

Download some of my programs and OCXs

Read the Tips here

The old style forum is still available here



Advanced Tip

in the first step.
make an access database and create a report in the database which you wanna run in visual basic 6 program. then put a command button on you form and then write the code to the command button click event. the code is under:

Private Sub Command1_Click ()
    Dim ac As Access. Application
    Set ac = New Access. Application
    Ac.opencurrentdatabase <Database Name with Pathname>
    Ac.visible = true
    Ac.DoCmd.OpenReport <Report Name>, acViewPreview
End Sub

Martin Allen 1999 - 2011.  Last updated Saturday 13 August 2011 12:14:23 AM +0100.