This is useful clarification - thank you. There are still details missing, however. What is the name of the table? What is the name of the field that makes each record in the 100 records unique?
From what you have told me so far, there are ten reports to be run. If I was being naive about it I would provide you with a simple loop in which a counter runs from 1 to 10, that opens each report in turn. However, such an approach has nothing whatsoever to do with the 100 records you mention:
- Dim Counter as Integer
-
For Counter = 1 to 10
-
DoCmd.OpenReport Str(Counter), acViewNormal
-
Next Counter
I know from experience that is not what you need - but what you have told me does not actually help me to provide you with a full solution. The norm is to process the recordset contents in a different kind of loop like the one below. To print each record separately as you are requesting you need to filter the report for each unique record, but you have not said what field that is. A placeholder is shown below for the table name and for that unique field.
[code=vb]Dim RS as DAO.RecordSet
Dim ReportNo as String
Dim ReportFilter as String
Set RS = CurrentDB.OpenRecordset("name of your 100 record table")
Do While Not RS.EOF
ReportNo = Str(RS!
- )
-
ReportFilter = "[unique record ID] = " & RS![unique record ID]
-
DoCmd.OpenReport ReportNo, acViewNormal, , ReportFilter
-
RS.Movenext
-
Loop
-
RS.Close
The skeleton above is incomplete because, as I have said, the missing details are not things I can guess at. The code above assumes that the unique ID is some form of number. If it is a string value change the filter line to
- ReportFilter = "[unique record ID] = '" & RS![unique record ID] & "'"
Add the code above to the On Click event of a control you place on a form somewhere. You may also need to add a reference to the DAO Object library - from the VB editor choose Tools, References and tick the MS DAO 3.x object library if it is not already ticked.
I am sure that once you fill in the missing details that I cannot you will be able to resolve any remaining issues reasonably easily yourself.
-Stewart