Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use Microsoft Access Report In VB

Status
Not open for further replies.

tkyap

Programmer
Sep 26, 2001
7
0
0
MY
Dear All:
How to use/call Microsoft Access Report from VB.
 
First go to Project>>References, and select Microsoft Access 8.0 Object Library, or whatever the most current version is. Then do this

Dim objAccess As New Access.Application
Set objAccess = CreateObject("Access.Application")
objAccess.OpenCurrentDatabase ("C:\dbname.mdb")
objAccess.DoCmd.OpenReport "reportname",acViewPreview
'use acViewPreview or it will print right away
objAccess.DoCmd.Maximize
objAccess.CloseCurrentDatabase
Set objAccess = Nothing
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top