Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Hiding Controls in a Report

    I have a report with several subreports attached. See Attachment.

    I would like to hide two controls (TechActivity1) and TechActivity1Fee) on the page and the connected subreport when the (TechActivity1) textbox contains the word "None".

    I have tried several things with limited success. Can someone help?

    Thanks.

    Paul
    Attached Files Attached Files

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    Have a look at the attached. This code goes in the Format event of the Detail Section

    Code:
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
        If Me.TechActivity1 = "none" Then
            Me.TechActivity1.Visible = False
            Me.TechActivity1Fee.Visible = False
            Me.subrptTechnologyWorkshopsActivity1.Visible = False
        Else
    
            Me.TechActivity1.Visible = True
            Me.TechActivity1Fee.Visible = True
            Me.subrptTechnologyWorkshopsActivity1.Visible = True
    
        End If
    End Sub
    To make it work I renamed some controls so their Name was the same as their Control Source. TechActivity1 was called Combo140 I think, for example.
    Attached Files Attached Files
    Last edited by johnhutchison; 2011-02-03 at 16:04.
    Regards
    John



  3. #3
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    John - The zip file you sent appears to be corrupt. Could you send it again.

    I have not had time yet to try the code you posted.

    Thanks.

    Paul

  4. #4
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts
    I have replaced the attachment, but I doubt that it will make any difference. I was able to download the previous attachment and open it OK.

    There has been a report of a problem with the attachment system.
    Regards
    John



  5. #5
    2 Star Lounger
    Join Date
    Apr 2008
    Posts
    188
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Your code works great!

    Thanks again.

    Paul

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •