how to add record set in report query

hfs

Registered User.
Local time
Yesterday, 22:02
Joined
Aug 7, 2013
Messages
47
here is my code
Code:
Private Sub Command37_Click()
  Dim db            As DAO.Database
Dim rsItems As DAO.Recordset
Dim SQL As String
Dim currentItemNumber As Long
 
 Set db = CurrentDb()
 SQL = "SELECT test0.item  FROM test0 "
Set rsItems = CurrentDb.OpenRecordset(SQL)
rsItems.MoveFirst
Do While Not rsItems.EOF
currentItemNumber = rsItems!Item
 
DoCmd.OpenReport "test0", acViewPreview, , , acWindowNormal, rsItems!Item
 
 
rsItems.MoveNext
Loop
End Sub
 
i need help with adding record set in report and displaying a report


i want every record to pass thru recodset and create a report for every record separately
 
Last edited:
1) Use a static query for your report.
Open the report, using a Where that include a parameter, in a loop that change that parameter.

2) Use dynamic (parametrized) query as base for your report
Open the report in a loop that change that parameter.

3)Use a static query and base the report on this query.
In the report Open event define a Filter that use a parameter (public variable) and apply this filter.
Design a public function that return the value for that variable
Use a loop that change that variable and open the report.

Good luck !
 

Users who are viewing this thread

Back
Top Bottom