Results 1 to 6 of 6
  1. #1
    jimbofoxman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    6

    Hide GroupFooter2 if nothing is GroupHeader1 is not visible....

    I am trying to hide GroupFooter2 if GroupHeader1 is not visible. I setup the following, and tried several different variants with no luck. I have tried it in both the OnPrint and OnFormat in both the header and footer sections.



    =IIf([GroupHeader1].[Visible]="0",[GroupFooter2].[Visible]="0",[GroupFooter2].[Visible]="-1")

    GroupHeader1 and GroupFooter2 are in the same group. Report is first grouped by "Salesman" and then by "CommCode"

    Any thoughts?

  2. #2
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would suggest that the value for which you are looking is numeric (0, -1) and not a string ("0", "-1")

  3. #3
    jimbofoxman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    6
    I had tried that too, should of mentioned it and just tried it again. It doesn't seem to pay attention to whether GroupHeader1 is visible or not, GroupFooter2 is always visible.....no matter what GroupHeader1 is doing.

  4. #4
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    I would start by making sure you can set the .Visible property to False (0) from some event such as the OnFormat event. What method are you using to make the GroupHeader1 invisible?

  5. #5
    jimbofoxman is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Feb 2012
    Posts
    6
    Quote Originally Posted by RuralGuy View Post
    What method are you using to make the GroupHeader1 invisible?
    It's only visible because of the second group (CommCode). If that salesperson some have a CommCode sale that grouping doesn't show up.

    I also tried it in a Event Procedure with this.... (It's suppose to be groupheader0, not 1. Just a typo in the post)

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

    If [GroupHeader0].Visible = True Then
    [GroupFooter2].Visible = True
    ElseIf [GroupHeader0].Visible = False Then
    [GroupFooter2].Visible = False
    End If

    End Sub

  6. #6
    RuralGuy's Avatar
    RuralGuy is offline Administrator
    Windows 7 64bit Access 2010 32bit
    Join Date
    Mar 2007
    Location
    8300' in the Colorado Rocky Mountains
    Posts
    12,922
    As I said, as a test try the following and see if the Footer goes invisible.
    Code:
    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
    
    '    If [GroupHeader0].Visible = True Then
    '        [GroupFooter2].Visible = True
    '    ElseIf [GroupHeader0].Visible = False Then
    '        [GroupFooter2].Visible = False
    '    End If
    
       Me.GroupFooter2.Visible = False
    
    End Sub

Please reply to this thread with any new information or opinions.

Similar Threads

  1. jzwp11 Code - Visible/Hide fields
    By GraemeG in forum Programming
    Replies: 19
    Last Post: 02-17-2011, 11:30 AM
  2. Replies: 2
    Last Post: 01-06-2011, 04:38 AM
  3. variable NOT visible -Please help
    By iamraja5 in forum Programming
    Replies: 10
    Last Post: 11-07-2010, 11:02 AM
  4. Invisible/visible box
    By teirrah1995 in forum Forms
    Replies: 4
    Last Post: 10-03-2010, 02:45 AM
  5. Tab only visible when field = x
    By ecpike in forum Forms
    Replies: 7
    Last Post: 06-08-2009, 04:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums