repeated records when i copied the controls.b

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i made a costum report of many controls in the detail section and it fits
five records max based on a query, my problem is if there is less than five
records then it leaves the remaining sheet blank, i want to be able to have
five records on a sheet even if there is no data in the rest of them so that
data can be filled by hand later on. i tried copying all the controls and
pasting them but it only displays one record repeated 5 times.

thanks for ur help:)
 
You haven't really said what you would expect to see in the blank areas. You
could add lines with code like below. The code could be modified to print
any text or whatever.
'---------------------------------------------------------------------------
------------
' 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 = 5
intDetailHeight = Me.Section(acDetail).Height
intPageHeadHeight = Me.Section(3).Height
For intLineNum = 1 To intNumLines
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
 
Back
Top