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
351 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 57
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 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 250 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Record with #Error 8 33
Access 2010 get Name of local computer from Terminal server 19 49
VBA Vbscript  Issue 9 25
Collapse and expand table in Word 2010 2 33
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

860 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