Detail Section Size

G

Guest

Each week we send out a request for files using data contained in a database
on our warehouse load. The report is based on a query using this data.
Problem: the detail section of the report needs to be the same size (15
lines) whether there is one file as a result of the query or 15. I also need
the lines numbered 1 to 15 within this detail section. The header/footer are
stationary, and I’m not having an issue with them. My field results are
fine, I just don’t know how to keep the detail section an exact measurement
and print blank lines if there is no result.
 
D

Duane Hookom

You might want to modify this code that prints 30 lines with line numbers...
'---------------------------------------------------------------------------------------
' Procedure : Report_Page
' DateTime : 8/9/2004 14:13
' Author : hookomd
' Purpose :
'---------------------------------------------------------------------------------------
'
Private Sub Report_Page()
Dim intNumLines As Integer
Dim intLineNum As Integer
Dim intDetailHeight As Integer
Dim intPageHeadHeight As Integer
On Error GoTo Report_Page_Error

intNumLines = 30
intDetailHeight = Me.Section(acDetail).Height
intPageHeadHeight = Me.Section(3).Height
For intLineNum = 1 To intNumLines
Me.CurrentY = (intLineNum - 1) * intDetailHeight + intPageHeadHeight
Me.CurrentX = 0
Me.FontBold = True
Me.FontSize = 14
Me.Print intLineNum 'print the line number
Me.Line (0, intPageHeadHeight + intLineNum * intDetailHeight)- _
Step(Me.Width, 0)
Next

On Error GoTo 0
Exit Sub

Report_Page_Error:
Select Case Err
Case 2462 'no page header
intPageHeadHeight = 0
Resume Next
End Select
MsgBox "Error " & Err.Number & " (" & Err.Description & _
") in procedure Report_Page of VBA Document Report_Report1"

End Sub
 
G

Guest

Thanks, Duane! This met with partial success...the lines were overprinting
my header/footer, but I modified the code a little to get it to only produce
lines in the detail section. I still am not getting the detail section as a
"static" height, but I'm closer than I was yesterday. What did we miss?
 

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