Optional Footers on a Report?

TheSearcher

Registered User.
Local time
Today, 13:11
Joined
Jul 21, 2011
Messages
408
Hi All,
Is it possible to have three different report footers on the same report? I want to show one footer at a time depending on a condition met in the detail section. I already know how to check the condition but I need to know how to do the rest.
Ex:
if condition1 = A then
me!reportfooter_1.visible = true
me!reportfooter_2.visible = false
me!reportfooter_3.visible = false
end if

Many Thanks,
TS
 
AFAIK - no. But you can prepare the controls in 3 sets such that only one set is visible.

You then set visibility in the footer's onFormat event. Use the .Tag property for each control. It is then easy to loop through all controls of the footer and set their visibility as required.
 
Thanks Spikepl. I was hoping to avoid that as the footer would then be very crowded with controls. Multiple optional footers would keep things nice and neat. But it is what it is.
 
I am not sure if this will help you or not, but I had the same requirement some time back. See: http://www.access-programmers.co.uk/forums/showthread.php?t=249675

I can now print out the same report with three different footers. It took me a while to get through it, but it works like a charm now. If you want I can send you the VBA I use on the print button that calls the report and the OnLoad code of the report itself that sets the Open Arguments. The credit goes to those who helped me.
 
you could have a single subreport in the footer with 3 different reports each with the appropriate layout then assign the appropriate report to the subreport sourceobject
 
Thank you Eljefegeneo and CJ_London for your responses.
CJ_London - can you please elaborate a bit on your idea? I don't clearly understand what you are suggesting.
 
I don't know what you want in each footer so difficult to describe so lets say you want one footer with controls 1,2 and 3, a second with controls 4, 5 and 6 and a third with controls 7, 8 and 9,

Create a new report with controls 1,2 and 3, save as report123
Create a second report with controls 3, 4 and 5, save as report456
Create a third report with controls 7,8 and 9, save as report789

All laid out as you would want them in the main report footer

In your main report footer add a sub report control - lets call it reportfootersubform - no need to specify a sourceobject at this point. Depending on requirements this may or may not take up the whole width and depth of the footer section.

Assuming the condition is met when the report is opened, in the main report on open event put code which will be something like

Code:
select case condition
    case 1
          reportfootersubform.sourceobject="report123"
    case 2
          reportfootersubform.sourceobject="report456"
    case 3
          reportfootersubform.sourceobject="report789"
end select

you may also need to set linkchild and linkmaster properties but you haven't supplied sufficient information to know whether this is required or not.
 
That is an excellent explanation. I understand now.
Thank you very much. I will try it.
 

Users who are viewing this thread

Back
Top Bottom