var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
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.
Last edited by Mark Gambo; 09-02-03 at
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
*** 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
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).