GroupFooter

D

Duane

I have a report where I have several controls in the Supervisor Group
Footer. I have a check box in the detail section of the report. The report
is named Daily, the check box is named CleanStreets. I would like the
controls in the footer section of the report to be visible ONLY when the
check box is ticked.

I might be going about this totally wrong, but I have tried to reference the
check box from the OnFormat portion of the Supervisor Group Footer. This is
what one of the things I have tried:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

If Reports!Daily.[CleanStreets] = -1 Then
[Label98].Visible = True
[Label100].Visible = True
[Label101].Visible = True
[Label102].Visible = True
[Label103].Visible = True
[Label149].Visible = True
[AreaCleaned].Visible = True
[RoadsCleand].Visible = True
[TotalHours].Visible = True
[TotalTrashBags].Visible = True
[MilesCleaned].Visible = True
[TotalPrisoners].Visible = True
Else
[Label98].Visible = False
[Label100].Visible = False
[Label101].Visible = False
[Label102].Visible = False
[Label103].Visible = False
[Label149].Visible = False
[AreaCleaned].Visible = False
[RoadsCleaned].Visible = False
[TotalHours].Visible = False
[TotalTrashBags].Visible = False
[MilesCleaned].Visible = False
[TotalPrisoners].Visible = False
End If

End Sub


I have done different variations, however, none have worked. Can anyone
give me a hand? Thanks
 
T

tina

do you have only one Detail record for each instance of the footer section
you're dealing with? if not, i'm not sure how the system will react to
multiple (and potentially different) instances of the value that you're
checking in the code.

the code itself looked okay to me. but there are a couple tricks that can
make it a bit more streamlined:

if the controls that you're manipulating are the only controls in the
section, you may want to just use the section's Print event instead of the
Format event, and cancel the event if the value is False, as

Cancel = Not Me!CleanStreets

so, if the checkbox is True then Cancel = False, and vice versa.

or, if you need the section to remain visible at all times, because there
are other controls in it, the following code will "toggle" showing the
controls you're concerned with, as

Dim bln As Boolean

With Me
bln = !CleanStreets

!Label98.Visible = bln
!Label100.Visible = bln
!Label101.Visible = bln
!Label102.Visible = bln
!Label103.Visible = bln
!Label149.Visible = bln
!AreaCleaned.Visible = bln
!RoadsCleand.Visible = bln
!TotalHours.Visible = bln
!TotalTrashBags.Visible = bln
!MilesCleaned.Visible = bln
!TotalPrisoners.Visible = bln
End With

and finally, if the labels listed in the code are "attached" to the textbox
(?) controls also listed, then you shouldn't need to set their Visible
properties separately. if a textbox control (or combobox or listbox) has
its' Visible property set to False, the attached label should automatically
be invisible, too.

hth


Duane said:
I have a report where I have several controls in the Supervisor Group
Footer. I have a check box in the detail section of the report. The report
is named Daily, the check box is named CleanStreets. I would like the
controls in the footer section of the report to be visible ONLY when the
check box is ticked.

I might be going about this totally wrong, but I have tried to reference the
check box from the OnFormat portion of the Supervisor Group Footer. This is
what one of the things I have tried:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As Integer)

If Reports!Daily.[CleanStreets] = -1 Then
[Label98].Visible = True
[Label100].Visible = True
[Label101].Visible = True
[Label102].Visible = True
[Label103].Visible = True
[Label149].Visible = True
[AreaCleaned].Visible = True
[RoadsCleand].Visible = True
[TotalHours].Visible = True
[TotalTrashBags].Visible = True
[MilesCleaned].Visible = True
[TotalPrisoners].Visible = True
Else
[Label98].Visible = False
[Label100].Visible = False
[Label101].Visible = False
[Label102].Visible = False
[Label103].Visible = False
[Label149].Visible = False
[AreaCleaned].Visible = False
[RoadsCleaned].Visible = False
[TotalHours].Visible = False
[TotalTrashBags].Visible = False
[MilesCleaned].Visible = False
[TotalPrisoners].Visible = False
End If

End Sub


I have done different variations, however, none have worked. Can anyone
give me a hand? Thanks
 
D

Duane

Thank you for your quick response. I will give your ideas a shot.
Typically, a supervisor works a five day work week and only does the clean
street project one of the days. You are correct, if they did worked the
clean streets project twice in one week, there would be problem.

Probably the best thing for me to do is re-arrainged the detail section, put
these controls in the detail section. I know the code is kind of clunky,
but I don't understand why they weren't visible.

Thanks...


tina said:
do you have only one Detail record for each instance of the footer section
you're dealing with? if not, i'm not sure how the system will react to
multiple (and potentially different) instances of the value that you're
checking in the code.

the code itself looked okay to me. but there are a couple tricks that can
make it a bit more streamlined:

if the controls that you're manipulating are the only controls in the
section, you may want to just use the section's Print event instead of the
Format event, and cancel the event if the value is False, as

Cancel = Not Me!CleanStreets

so, if the checkbox is True then Cancel = False, and vice versa.

or, if you need the section to remain visible at all times, because there
are other controls in it, the following code will "toggle" showing the
controls you're concerned with, as

Dim bln As Boolean

With Me
bln = !CleanStreets

!Label98.Visible = bln
!Label100.Visible = bln
!Label101.Visible = bln
!Label102.Visible = bln
!Label103.Visible = bln
!Label149.Visible = bln
!AreaCleaned.Visible = bln
!RoadsCleand.Visible = bln
!TotalHours.Visible = bln
!TotalTrashBags.Visible = bln
!MilesCleaned.Visible = bln
!TotalPrisoners.Visible = bln
End With

and finally, if the labels listed in the code are "attached" to the
textbox
(?) controls also listed, then you shouldn't need to set their Visible
properties separately. if a textbox control (or combobox or listbox) has
its' Visible property set to False, the attached label should
automatically
be invisible, too.

hth


Duane said:
I have a report where I have several controls in the Supervisor Group
Footer. I have a check box in the detail section of the report. The report
is named Daily, the check box is named CleanStreets. I would like the
controls in the footer section of the report to be visible ONLY when the
check box is ticked.

I might be going about this totally wrong, but I have tried to reference the
check box from the OnFormat portion of the Supervisor Group Footer. This is
what one of the things I have tried:

Private Sub GroupFooter0_Format(Cancel As Integer, FormatCount As
Integer)

If Reports!Daily.[CleanStreets] = -1 Then
[Label98].Visible = True
[Label100].Visible = True
[Label101].Visible = True
[Label102].Visible = True
[Label103].Visible = True
[Label149].Visible = True
[AreaCleaned].Visible = True
[RoadsCleand].Visible = True
[TotalHours].Visible = True
[TotalTrashBags].Visible = True
[MilesCleaned].Visible = True
[TotalPrisoners].Visible = True
Else
[Label98].Visible = False
[Label100].Visible = False
[Label101].Visible = False
[Label102].Visible = False
[Label103].Visible = False
[Label149].Visible = False
[AreaCleaned].Visible = False
[RoadsCleaned].Visible = False
[TotalHours].Visible = False
[TotalTrashBags].Visible = False
[MilesCleaned].Visible = False
[TotalPrisoners].Visible = False
End If

End Sub


I have done different variations, however, none have worked. Can anyone
give me a hand? Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top