[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 364
  • Last Modified:

I need to hide an image on the page footer of my report when pages are larger than 1

When printing my report, I need to hide the footer, image (Image73) when the page number is higher than 1.
I used a macro previously to run on printing the footer section, but I want to use VBA so that the code is embedded in the report.

I tried the following three ways to address the image's visibility.

The errormessage says "Runtime error 424.         Object Required"

Private Sub PageFooterSection_Print(Cancel As Integer, PrintCount As Integer)
    If Me.Page > 1 Then
    '    [Reports]![rptNurseryOrdersConfirmation]![Image73].[Visible] = False
    '    Me![Image73].[Visible] = False
    '    [Image73].[Visible] = False
    Else
    End If
End Sub

Please point me in the right direction.
0
Fritz Paul
Asked:
Fritz Paul
  • 2
  • 2
1 Solution
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

  Me.Image73.visible = False

 should do it...

JimD.
0
 
Fritz PaulAuthor Commented:
It worked,
So just the omittance of the brackets did that?
Will you please give me a hint why that worked?
Thanks
0
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:

   To be honest I can't say as I've never tried it but the correct way.  However it was most likely the [] around the property 'visible'.   [] are to be used in conjunction with objects.

    The other difference is the . instead of the ! after ME.  The "bang" (!) is the old style notation.

   In the past, one always used a bang to denote a reference to an object, and a dot to represent a property or method followed.

  A change in Access/VBA several revs back makes that no longer a requirement.  But while the old notation still works, I have seen times where Access seems to get confused unless you do it the new way.

Jim.
0
 
Fritz PaulAuthor Commented:
Thanks a lot!
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now