G
Guest
Hi,
I have a command button on a form which prints 16 reports without a problem
-- here's the code snippet:
Dim stDocName As String
Dim i As Integer
i = 1
Do While i <= 16
stDocName = "rptVA" & i
DoCmd.OpenReport stDocName, acNormal
i = i + 1
Loop
Exit Sub
However, if reports are added (or deleted) I have to change the integer on
the do while line. Easy enough, but is there a way to use the Reports.Count
property to count the number of reports that begin with "rptVA"?
TIA
Allan
I have a command button on a form which prints 16 reports without a problem
-- here's the code snippet:
Dim stDocName As String
Dim i As Integer
i = 1
Do While i <= 16
stDocName = "rptVA" & i
DoCmd.OpenReport stDocName, acNormal
i = i + 1
Loop
Exit Sub
However, if reports are added (or deleted) I have to change the integer on
the do while line. Easy enough, but is there a way to use the Reports.Count
property to count the number of reports that begin with "rptVA"?
TIA
Allan