Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2005
    Location
    Chandler, AZ
    Posts
    7

    Unanswered: add blank line in report

    I am trying to add a blank line at certain points in a report for the sake of readability. I searched the theads and tried everything i found but no luck so far.

    In the code below i want to add a blank line in the report when the main_title ="ValueOptions"

    I have tried all the things that are in the code but they don't do the job. Any help would be appreciated.

    How do you guys manage to make your posted code look good? Mine looks like poop.



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

    Select Case Main_Title

    Case "CPSA 3"

    'Mark forcast area
    If Forms!CriterialManagementRptsFRM.NextFYOption = "-1" Then
    Exit Sub
    End If

    If Forms!CriterialManagementRptsFRM.NextFYOption = "0" Then
    v_Month_Number = Month(v_through_date)

    If v_Month_Number = 6 Then 'if its really the end of the year then dont hightlight anything
    Exit Sub
    End If

    Else
    v_Month_Number = 6
    End If

    Do While (True)

    If v_Month_Number = 12 Then
    v_Month_Number = 0
    End If

    '12632256 = black/grey
    v_Month_Number = v_Month_Number + 1
    Controls.Item(MonthName(v_Month_Number, True)).BackColor = 12632256

    If v_Month_Number = 6 Then
    Exit Do
    End If
    Loop

    'HERE is my problem area where i want a blank line. and none of the things below worked
    Case "ValueOptions"
    Me.MoveLayout = True
    Me.PrintSection = False
    Me.NextRecord = False
    Me.Print
    Me.Print Chr(10) & Chr(13)
    Me.Print


    Case Else ' Other values make back color transparent.
    Me.NextRecord = True

    Jul.BackColor = 16777215
    Aug.BackColor = 16777215
    Sep.BackColor = 16777215
    Oct.BackColor = 16777215
    Nov.BackColor = 16777215
    Dec.BackColor = 16777215
    Jan.BackColor = 16777215
    Feb.BackColor = 16777215
    Mar.BackColor = 16777215
    Apr.BackColor = 16777215
    May.BackColor = 16777215
    Jun.BackColor = 16777215

    End Select

    End Sub

  2. #2
    Join Date
    Jan 2005
    Location
    Chandler, AZ
    Posts
    7
    Nobody knows how to do this?

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    First, you can make your posted code look better by enclosing it in Code tags:

    [ c o d e ]
    Your code here.
    Remove the spaces from the Code tags.
    [ / c o d e ]

    Code:
    Your code here.
    Spaces removed from code tags.
    Second, please clarify. You want a blank row every 6 rows, or when the data matches some criteria?
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    Try something like this, tied to the OnFormat event of the detail section of your form:

    Code:
    Option Compare Database
    Dim RowCounter As Integer
    
    Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
    RowCounter = RowCounter + 1
    If RowCounter = 6 Then
        Me.Section(0).Height = 400
        RowCounter = 0
    Else
        Me.Section(0).Height = 200
    End If
    End Sub
    If it's not practically useful, then it's practically useless.

    blindman
    www.chess.com: "sqlblindman"
    www.LobsterShot.blogspot.com

  5. #5
    Join Date
    Jan 2005
    Location
    Chandler, AZ
    Posts
    7
    Blindman

    Thanks for your reply. I am going to attempt to add the code with "code" tags and see if it's more readable.


    My goal is to add a line where main_title = "ValueOptions" (see orange section)

    I will try your suggested code.

    Thanks again.

    Code:
    Private Sub GroupFooter5_Format(Cancel As Integer, FormatCount As Integer)
    
    Select Case Main_Title
    
    Case "CPSA 3"
            
            'Mark forcast area
            If Forms!CriterialManagementRptsFRM.NextFYOption = "-1" Then
                Exit Sub
            End If
            
            If Forms!CriterialManagementRptsFRM.NextFYOption = "0" Then
                v_Month_Number = Month(v_through_date)
                
                If v_Month_Number = 6 Then   'if its really the end of the year then dont hightlight anything
                    Exit Sub
                End If
    
            Else
                v_Month_Number = 6
            End If
            
            Do While (True)
            
                If v_Month_Number = 12 Then
                    v_Month_Number = 0
                End If
                
                '12632256 = black/grey
                v_Month_Number = v_Month_Number + 1
                Controls.Item(MonthName(v_Month_Number, True)).BackColor = 12632256
                
                If v_Month_Number = 6 Then
                    Exit Do
                End If
            Loop
    
    Case "ValueOptions"
    '    Me.MoveLayout = True
    '    Me.PrintSection = False
    '    Me.NextRecord = False
    '    Me.Print
    '    Me.Print Chr(10) & Chr(13)
    '    x = Me.PrintCount
        Me.Print
        
    
    
    Case Else    ' Other values make back color transparent.
            Me.NextRecord = True
    
        Jul.BackColor = 16777215
        Aug.BackColor = 16777215
        Sep.BackColor = 16777215
        Oct.BackColor = 16777215
        Nov.BackColor = 16777215
        Dec.BackColor = 16777215
        Jan.BackColor = 16777215
        Feb.BackColor = 16777215
        Mar.BackColor = 16777215
        Apr.BackColor = 16777215
        May.BackColor = 16777215
        Jun.BackColor = 16777215
    
    End Select
    
    
    End Sub

  6. #6
    Join Date
    Jan 2005
    Location
    Chandler, AZ
    Posts
    7
    Blindman,

    First there is an errant piece of code under the "else". Something i was playing with.

    Looking at you code i'm not sure how to adapt that to add a line to my report. I apologize if i seem a little dense

    Thanks

Posting Permissions

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