[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2011-03-17
4
Medium Priority
?
362 Views
Last Modified: 2012-06-22
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
Comment
Question by:Fritz Paul
  • 2
  • 2
4 Comments
 
LVL 58
ID: 35155708

  Me.Image73.visible = False

 should do it...

JimD.
0
 

Author Comment

by:Fritz Paul
ID: 35155766
It worked,
So just the omittance of the brackets did that?
Will you please give me a hint why that worked?
Thanks
0
 
LVL 58

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 1000 total points
ID: 35155871

   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
 

Author Closing Comment

by:Fritz Paul
ID: 35155977
Thanks a lot!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question