Results 1 to 4 of 4

Thread: Integrating an Access Report into VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 1999
    Location
    London, UK
    Posts
    5

    Post

    Can anyone tell me how easy (or difficult) it is to integrate an Access97 report into a VB6 app. If it is easy, a simple explanation of how to do it would be greatly appreciated.

    Thanx in advance

    Steve

  2. #2
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    It's not too bad with a little automation:

    User must have Access installed on system -- Add a reference to the Access Object Library.


    Dim axs As New Access.Application

    axs.OpenCurrentDatabase ("c:\data\path\here.mdb")
    axs.DoCmd.OpenReport "ReportNameHere", acViewNormal
    axs.CloseCurrentDatabase

    Set axs = Nothing

    This will print the report -- but as far as complete integration with your app (without MS Access) I do not believe that you can access the report like you can with a table or query.

    HTH

    Tom

  3. #3
    Guru Clunietp's Avatar
    Join Date
    Oct 1999
    Location
    USA
    Posts
    1,844

    Post

    check out the second and third parameters of the DoCmd function, you can specify a filter and/or a where condition. Otherwise, you can access the report via the axs.reports collection and manipulate report properties there (like set the SQL statement of the recordsource before you print it). I didn't try it myself, let me know if you have problems.

    Tom

  4. #4

    Thread Starter
    New Member
    Join Date
    Oct 1999
    Location
    London, UK
    Posts
    5

    Post

    Thanks Tom, that works great. Any idea about how to give my a report a parameter from VB. Any info will be greatly appreciated.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width