blindlemonray
Technical User
I am trying to output a report to a printer several times but change the report content based on the value of each row in a table.
I can loop for each value in the table and print a report. But I cannot figure out how to use the value of each row as a criteria in the report.
So I have a report and instead of creating a report for each user and printing, create a table of users and then print the report for each user in the table using the table as the criteria in the report.
Code shown below if it helps
any help really appreciated.
I can loop for each value in the table and print a report. But I cannot figure out how to use the value of each row as a criteria in the report.
So I have a report and instead of creating a report for each user and printing, create a table of users and then print the report for each user in the table using the table as the criteria in the report.
Code shown below if it helps
Code:
Private Sub Command69_Click()
Dim cnCurrent As ADODB.Connection
Dim rsCallers As ADODB.Recordset
Set cnCurrent = CurrentProject.Connection
Set rsCallers = New ADODB.Recordset
rsCallers.Open "Accmans", cnCurrent, adOpenDynamic, adLockOptimistic
Do Until rsCallers.EOF
DoCmd.OpenReport "user", acViewNormal
rsCallers.MoveNext
If rsCallers.EOF Then Exit Do
Loop
Exit Sub
End Sub
any help really appreciated.