CodeWidgets.com: Online Source Code Library: C#, ASP, ASP.NET, VB, VB.NET, VB Script, Microsoft Access, Excel, JavaScript, J Script, XML, VBScript, Website Design, DevExpress Components, Reporting, Application and Website Templates.

Widget #CS0065

Centralized OpenReport Function for Microsoft Access 2000-2016

Free

Microsoft® Access 97, 2000, XP

Public Function OpenReport(ReportName As String, Optional Criteria As String) As Boolean
On Error GoTo ErrHandler
Dim ReportMode As Integer
'<Prompt>
If MsgBox("Would you like to preview this report?", vbYesNo) = vbYes Then ReportMode = acViewPreview Else ReportMode = acNormal
'</Prompt>
'<DoReport>

If Criteria = "" Then
DoCmd.OpenReport ReportName, ReportMode
Else
DoCmd.OpenReport ReportName, ReportMode, , Criteria
End If
OpenReport = True
'</DoReport>
Exit Function
ErrHandler:
'<ErrorHandler>
DoCmd.Echo True, "Unable to run report"
OpenReport = False
'</ErrorHandler>
End Function

Last Updated: 4/27/2018


Related Widgets 
Price 
# 
CS0035 Alternate row colors on reports with Microsoft Access 2000-2016$0.00Add To Cart
CS0037 Microsoft Access Monthly Calendar Report (MDB)$10.00Add To Cart

Recently Viewed Widgets 
Price 
# 
CS0065: Centralized OpenReport Function for Microsoft Access 2000-2016$0.00Add To Cart

Collapse/Expand
Format

Plug & Play Code

Copy the Source Code Above..


Collapse/Expand
License

License

No Restrictions

Re-Distribution Permitted
This source code is provided to you "as is" without warranty
CLICK HERE FOR TERMS OF USE
Copyright 2000-2006 Comrie Software Solutions


This website uses Cookies to store User information and Shopping Cart Items for the duration of your visit to CodeWidgets.com.

No Credit Card or Financial information is stored by CodeWidgets.com. Click Here For Our Complete Privacy Policy and Terms of Use.

I Understand