D
Dale
Hi all and thanks for any help with this.
I can't seem to get this code to show more than one report in preview.
There are 18 owners so there should be report previews? I believe the code
is working:
1) The debug window shows 18 instances of owners
2) All18 reports are sent directly to the printer if I leave "acPreview"
blank.
I however want to preview the reports before printing. Code as follows
produces in preview only the very first owner:
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblOwners")
rst.MoveFirst
Do Until rst.EOF
Debug.Print rst!Owner
DoCmd.OpenReport "rptValidationtest", acPreview, , "[Owner] = '" &
rst!Owner & "'"
rst.MoveNext
Loop
rst.Close
Set dbs = Nothing
I can't seem to get this code to show more than one report in preview.
There are 18 owners so there should be report previews? I believe the code
is working:
1) The debug window shows 18 instances of owners
2) All18 reports are sent directly to the printer if I leave "acPreview"
blank.
I however want to preview the reports before printing. Code as follows
produces in preview only the very first owner:
Dim dbs As Database, rst As Recordset
Set dbs = CurrentDb
Set rst = dbs.OpenRecordset("tblOwners")
rst.MoveFirst
Do Until rst.EOF
Debug.Print rst!Owner
DoCmd.OpenReport "rptValidationtest", acPreview, , "[Owner] = '" &
rst!Owner & "'"
rst.MoveNext
Loop
rst.Close
Set dbs = Nothing