CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Guest

    Printing MS Access Reports

    Hi,

    Does anyone know if it is possible to print an already made MS Access report from VB? If so, does it require you to have MS Access installed on your machine?

    Thanks.


  2. #2
    Join Date
    Jul 1999
    Posts
    20

    Re: Printing MS Access Reports

    Hi


    Follow this URL to c what u want
    http://www.codeguru.net/bbs/wt/showp...&sb=5#Post5367

    Yes MS Access should me loaded

    Good Luck Praba


  3. #3
    Join Date
    May 1999
    Posts
    7

    Re: Printing MS Access Reports

    Is this URL still valid? I tried accessing it and got a not found error. Can you repost the answer to the question? I would like to print an Access report from a VB program. Thanks.

    Mel Lamelas


  4. #4
    Join Date
    Jul 1999
    Posts
    20

    Re: Printing MS Access Reports

    Hi,

    U need Acces97 installed.
    Create mdb biblio97.mdb (biblio.mdb will be in ur harddisk)
    Create a sample report, name it as "report1"

    create vb project.
    add a new form. Add command button in this form.
    Copy the code given below in the module area of the form. Change path if required for Mdb.
    run the project , click the button, "report1" will be printed.

    Regards
    Praba


    Option Explicit

    Private Sub Command1_Click()
    Dim objAcc As New access.Application

    Set objAcc = CreateObject("C:\BIBLIO97.MDB")

    objAcc.DoCmd.OpenReport "report1", acNormal
    objAcc.CloseCurrentDatabase
    objAcc.Quit
    Set objAcc = Nothing

    End Sub



  5. #5
    Join Date
    Oct 1999
    Posts
    7

    Re: Printing MS Access Reports

    And if I need the preview?? I tried with the acpreview option, but it doesn't work... why??


  6. #6
    Join Date
    Jul 1999
    Posts
    20

    Re: Printing MS Access Reports

    use acpreview parameter for OpenReport Method
    After this statement put some wait state. u can use API Sleep funnction for this



  7. #7
    Join Date
    Oct 1999
    Posts
    7

    Re: Printing MS Access Reports

    Example, please...


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

Featured