Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2003
    Posts
    11

    Unanswered: Event Procedures help...slow!

    Hello all.

    What I'm working on is setting the Visibility of a Bound Object Frame to False or No if there is no data beside it, so the space will collapse. Basically I'm just trying to get the "Can Shrink" functionality like you get with text boxes.

    I'm able to accomplish this all via Event Procedures in the Headers, however it is a bit slow, because it process all the code for all sub headers for each piece of data. Here is what my Report Design looks like:
    http://webpages.charter.net/orum/07.jpg

    And below is what the Event Procedure script looks like. It is one script for all headers as you can see. I think that is where the problem is, because if there is data in header 2, the code for headers 3 & 4 still get processed. I have large parts of the report that only have data in header 0 or 1, but for each instance of those pieces of data, all sub (2, 3, 4) headers' Event Procedure script sections gets run, and slows the report way down.

    Can split this code out, so only the header code for each header runs, with no extra? Thanks much.

    Code:
    Option Compare Database
    
    Private Sub GroupHeader0_Format(Cancel As Integer, FormatCount As Integer)
           
        If IsNull(Me.Tier0TaskName) Then
        Me!Tier0Icon.Visible = False
        Else
        Me!Tier0Icon.Visible = True
        End If
    
    End Sub
    
    Private Sub GroupHeader1_Format(Cancel As Integer, FormatCount As Integer)
        
        If IsNull(Me.Tier1TaskName) Then
        Me!Tier1Icon.Visible = False
        Else
        Me!Tier1Icon.Visible = True
        End If
        
    End Sub
    
    Private Sub GroupHeader2_Format(Cancel As Integer, FormatCount As Integer)
        
        If IsNull(Me.Tier2TaskName) Then
        Me!Tier2Icon.Visible = False
        Else
        Me!Tier2Icon.Visible = True
        End If
        
    End Sub
    
    Private Sub GroupHeader5_Format(Cancel As Integer, FormatCount As Integer)
    
        If IsNull(Me.Tier3TaskName) Then
        Me!Tier3Icon.Visible = False
        Else
        Me!Tier3Icon.Visible = True
        End If
        
    End Sub
    
    Private Sub GroupHeader6_Format(Cancel As Integer, FormatCount As Integer)
    
        If IsNull(Me.Tier4TaskName) Then
        Me!Tier4Icon.Visible = False
        Else
        Me!Tier4Icon.Visible = True
        End If
        
    End Sub

  2. #2
    Join Date
    Sep 2003
    Posts
    11
    Wow...I think have been looking at my screen too long. Of course it will have to process them all, if I want the objects' visibility set properly....right? I think we should just pretend I never posted to begin with. Thanks all.

  3. #3
    Join Date
    Nov 2003
    Posts
    1,487
    Me!Tier0Icon.Visible = Not IsNull(Me.Tier0TaskName)


    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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