Results 1 to 3 of 3
  1. #1
    Join Date
    May 2003
    Location
    New York, NY
    Posts
    225

    Unanswered: Opening an Access Database and print reports via VB

    I was wondering if anyone could help me with a Visual Basic Application that I am working on. I want to be able to open an Access Database select a report and then print it out.

    Thank you,

    Mark
    Last edited by Mark Gambo; 09-02-03 at 19:29.

  2. #2
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1

    Lightbulb

    Depends on how you want to open your report. If you want to select a report you can just double click it and then press the print icon.

    If however you wish to select a report via a form and then print that then this code should do it

    Add all the names of your reports into a combo box. Then in VBA

    ***defines your string that will be used to hold selected report name, type this underneath Option Explicit
    Dim strReportToPrint As String

    ***this would be a button onclick instruction
    Private Sub cmdPrintReport_Click()

    strReportToPrint = cboReportChoice

    DoCmd.OpenReport strReportToPrint, acViewNormal

    End Sub

    *** the acViewNormal prints the report straight out, you would have to specify acViewPreview if you wished to preview the report first
    Last edited by hickyUK; 09-02-03 at 06:05.

  3. #3
    Join Date
    May 2003
    Location
    New York, NY
    Posts
    225
    Hicky,
    I am sorry I wasn't very clear on what I am looking to do. I want to design a Visual Basic Application that will access an Access Database via ADO, RDO etc. and printout a specific report contained in that database. This should be done without the user knowing what is going on behind the scenes (so to speak).


    Thanks,

    Mark

Posting Permissions

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