C
CSharp
C++
Java
Visual Basic
HTML - CSS
Android
Asp
Asp.Net
Php
Python
JavaScript
SQL
XML
Assembly
ActiveX
API
Code Snippets
Database
Files Directories Drives
Forms
Graphics Games
Multimedia
Strings
Windows and Controls
More...
Visual Basic > Database SQL Stuff sample source codes
Visual Basic Code > Preview an Access Database Report
Preview an Access Database Report The function below can be used to preview a report created in MS Access. 'Purpose : Preview an Access Report from VB 'Inputs : sAccessDBPath The path and filename of the access database containing the report to show ' sReportName The name of the report to show 'Outputs : Returns an empty string on success, else returns an error message. Function AccessShowReport(sAccessDBPath As String, sReportName As String) As String Dim oAccess As Object 'Access.Application On Error GoTo ErrFailed AccessShowReport = "" 'Create Access Set oAccess = CreateObject("Access.Application") 'Open Database oAccess.OpenCurrentDatabase sAccessDBPath 'Open report oAccess.DoCmd.OpenReport sReportName, 0 'acViewNormal 'Show Access Report oAccess.Visible = True oAccess.CloseCurrentDatabase Set oAccess = Nothing Exit Function ErrFailed: Debug.Print Err.Description Debug.Assert False AccessShowReport = Err.Description If oAccess Is Nothing = False Then oAccess.CloseCurrentDatabase Set oAccess = Nothing End If End Function
Privacy Policy
|
Contact
|
Advertising
|
Link to Us
|
Directory