C
CAP101
I am trying to figure out how to repeat a detail line on a report
certain number of times. Example: FormA has a production record.
subform A has the details of that production record. I would like to b
able to repeat each detail line a specified number of times but th
code that I'm using will only repeat each detail line the same numbe
of times stated on the first detail line (each detail line has a fiel
in it to specify the number of times to repeat, called numberskids).
Also, if I add a text box in with the control source set to "=1" an
running sum to "over group" the number 1 just repeats itself for th
same number of times the detail line repeats itself instead of bein
incremental. The code is as follows:
Option Explicit
Dim intPrintCounter As Integer
Dim intNumberRepeats As Integer
Dim intSkidNumber As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Note: intNumberRepeats and intPrintCounter are initialized
' in the report's OnOpen event.
If intPrintCounter < intNumberRepeats Then
intPrintCounter = intPrintCounter + 1
' Do not advance to the next record.
Me.NextRecord = False
Else
' Reset intPrintCounter and advance to next record.
intPrintCounter = 1
Me.NextRecord = True
End If
End Sub
Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1
intNumberRepeats
Forms!frmProduction!sfrmProductionDetails.Form!numberskids
intSkidNumber = 1
End Sub
Any help would be much appreciated
certain number of times. Example: FormA has a production record.
subform A has the details of that production record. I would like to b
able to repeat each detail line a specified number of times but th
code that I'm using will only repeat each detail line the same numbe
of times stated on the first detail line (each detail line has a fiel
in it to specify the number of times to repeat, called numberskids).
Also, if I add a text box in with the control source set to "=1" an
running sum to "over group" the number 1 just repeats itself for th
same number of times the detail line repeats itself instead of bein
incremental. The code is as follows:
Option Explicit
Dim intPrintCounter As Integer
Dim intNumberRepeats As Integer
Dim intSkidNumber As Integer
Private Sub Detail_Format(Cancel As Integer, FormatCount As Integer)
'Private Sub Detail_Print(Cancel As Integer, PrintCount As Integer)
' Note: intNumberRepeats and intPrintCounter are initialized
' in the report's OnOpen event.
If intPrintCounter < intNumberRepeats Then
intPrintCounter = intPrintCounter + 1
' Do not advance to the next record.
Me.NextRecord = False
Else
' Reset intPrintCounter and advance to next record.
intPrintCounter = 1
Me.NextRecord = True
End If
End Sub
Private Sub Report_Open(Cancel As Integer)
intPrintCounter = 1
intNumberRepeats
Forms!frmProduction!sfrmProductionDetails.Form!numberskids
intSkidNumber = 1
End Sub
Any help would be much appreciated