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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

displaying access reports

Status
Not open for further replies.

DannyTmoov2

IS-IT--Management
Jan 7, 2003
49
GB
I would like to run and display an MS access report in a window with an option to print. What would be the most effective method of doing this. Would I perhaps be better off generating the reports on the fly in sql?

Any help will be very much appreciated.

Cheers
Dan
 
You can use the access library to open a report. i.e.
Code:
Dim AppAccess As New Access.Application
Dim strAccess as String

' Set Database
    straccess = App.Path & "\Back End\PrintsBE.mdb"
    
    ' Open Database
    AppAccess.OpenCurrentDatabase straccess
    
    ' Database Commands to Print Reports
    With AppAccess
              .DoCmd.OpenReport "Report1", acViewNormal
              .DoCmd.OpenReport "Report2", acViewPreview        
    End With
You can see that you can either open the report to preview it or you can just print the report (acViewPreview or acViewNormal).

----------------------------------------------------------------------

Need help finding an answer?

Try the search facilty ( or read FAQ222-2244 on how to get better results.
 
It is also neccessary to mention with that, the problem with re-distribution, if that is a factor here.

A licensed copy of the MS ACCESS runtime files (either via MOD or MS ACCESS) must be on the client machine in order to do this.
 
Is there anyway of displaying the report within a vb form without the user having an access licence?

Thanks
 

Use the SnapShotViewer.exe from MS.
Just go to the MS site and do a search.

 
Would like the user to be able to run reports as and when needed though, can sql reports be generated and saved as a txt file then viewed in form or something?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top