Basically I have all my Access reports accessing the following function upon when a PageFooterSection_Format is performed.
However not all reports have a label called lblLegend - thus where I have Else
objReport.lblLegend.Properties("Visible") = False I get a run-time error 2465 application object.
I absolutely cannot afford to get this error and have the On Error Resume Next does not work for some situations.
Is there anyway I can test to be sure that lblLegend exists before accessing the properties?
Public Function fncMyFooterFunction(objReport As Object)
On Error Resume Next
If Forms!frmReports!chkLegend = True Then
objReport.lblLegend.Properties("Visible") = True
objReport.LineLegend.Properties("Visible") = True
objReport.lblLegend.Properties("Top") = 1020
objReport.PageFooterSection.Height = 1.0833
objReport.PageFooter2.Height = 1.0833
objReport.lblLegend.Properties("Visible") = False
objReport.LineLegend.Properties("Visible") = False
objReport.PageFooterSection.Height = 0
objReport.lblLegend.Properties("Top") = 0
objReport.PageFooter2.Height = 0.5
Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline
The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Overview: This article:
(a) explains one principle method to cross-reference invoice items in Quickbooks®
(b) explores the reasons one might need to cross-reference invoice items
(c) provides a sample process for creating a M…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…