Full Version: Turn off footers
UtterAccess Discussion Forums > Microsoft® Access > Access Reports
wallen
Greetings All,
I have an report that I need to turn the footer off using code. I have tried all that I know, which is not much, but nothing works. Can anyone help?

Thanks.

wallen
HiTechCoach
Which footer (Group or page or report)?

You should be able to set the visible property to false
wallen
report footer
HiTechCoach
You can use this to turn on/off the report footer:

CODE
Me.ReportFooter.Visible = False


Depending on what will trigger the need to turn on or off the report footer, you could use something like the following

This example uses the Report Footer's On Format event:

CODE
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)



' if there no records then hide the report footer

If Me.HasData = True Then

    Me.ReportFooter.Visible = True

Else

    Me.ReportFooter.Visible = False



End If



End Sub



or

Simplified to

CODE
Private Sub ReportFooter_Format(Cancel As Integer, FormatCount As Integer)



' if there no records then hide the report footer

    Me.ReportFooter.Visible = Me.HasData



End Sub


Hope this helps...
wallen
That works for visiblity, but what I need is to make it go away all together.
HiTechCoach
Are you wanting change the report's design by deleting all the controls on the report footer with code?
wallen
Yes. That is what I seek! Sorry but I did not know how to word it.

Any help would be highly valued!

O
HiTechCoach
You will have to use VBA code to open the report in design mode and then delete the objects.

This is not something I would ever do since I use an MDE as the front end. SInce you can not open reports in design mode in an MDE, I have never tried to do anything like want you wnat to do.

Is there some reason that you can not do this manually and have to use VBA code?
wallen
Yes, I have a database, that a user imports a report and its corresponding table. Once in the database, I have written code that will create a query def based on one record in the table and then open the report (filtered for that one record of course) and then print to the pdf printer. Thereby creating separate PDF's from a report that originally had 500 records in 1 report. We then post these to our intranet. the users understand what their part is in all of this and can handle the importing part. However, some of the reports that are imported have the report footer and controls in them. The footers are not wanted in the indiviual reports that are converted. The users level of understanding of Access ends with importing. They will never get the hang of deleting the controls and turning off the footer before running the code. Thererfore I am looking for a way to automate the process.

Thanks

Bill
wallen
Well now this has truned out to be a moot point as I have learned that now it does not matter whether the footer shows or not.

Thanks for your input. I was very helpful

O
HiTechCoach
Bill,

You're welcome.

Glad we could assist.

uarulez2.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.