Results 1 to 5 of 5

Thread: Printing Access reports from vb?

  1. #1

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    -
    Posts
    10

    Post

    How can i print a access report from visual basic?

  2. #2
    New Member
    Join Date
    Aug 1999
    Location
    Corry,PA, USA
    Posts
    15

    Post

    It took me forever to find this code, but got it in one of the best db books around.. Database Access With VB6 by Jeffery Mcmanus..

    ' you need your access ref obj lib

    Dim MSACCESS as Access.application

    Private Sub PrintReport_Click()

    Set MSACCESS = New Access.Application

    MSACCESS.OpenCurrentDatabase ("c:\your dir\Your.mdb") ' This opens your db..

    MSACCESS.DoCmd.OpenReport "YourReportHere", acViewNormal This actualy opens your report from your Access (97?) db & then prints it..

    MSACCESS.CloseCurrentDatabase ' self explanitory

    Set MSACCESS = Nothing ' You need this, or you will keep access in memory & lag the user..

    There you have it!!! Use this code well & may all your reports print perfect!




    ------------------
    ~\*/~ Thank you....

  3. #3

    Thread Starter
    New Member
    Join Date
    May 1999
    Location
    -
    Posts
    10

    Post

    tHaNk YoU!!

    Will give it a try!

  4. #4
    New Member
    Join Date
    Aug 1999
    Location
    Corry,PA, USA
    Posts
    15

    Post

    No probs.. If you change the view style you can preview the report before printing as well.. It is a cool VBA trick..

    ------------------
    ~\*/~ Thank you....

  5. #5
    New Member
    Join Date
    Feb 1999
    Location
    South Africa
    Posts
    2

    Post

    HI, Zonnix / LordCallubonn

    How can I Send parameter to the report
    e.g. : From/ To Date

    Please email me directly as my email has changed and I don't know how change it on the BB.

    [email protected]

    Thanx

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