Question on previewing reports

C

CD Tom

I have a location table with four locations, I've setup a report to print by
location, the code do a loop through the location table and prints a separate
for each location. When I set it up to do a preview instead of printing I
only get the first report Here's the code I'm using.
stdsql = "Select * from location"
Set rsloc = db.OpenRecordset(stdsql)
Do While Not rsloc.EOF
VLocName = rsloc("locname")
vlocnum = rsloc("locnum")
stLinkCriteria = "[Supplierid]=" & "" & Me![cmbSupSel] & " and
datesale between #" & vbdate & "# and #" & Vedate & "# and branch = '" &
vlocnum & "'"
stdsql = "select * from [frame sales report] where datesale between
#" & vbdate & "# and #" & Vedate & "# and branch = '" & vlocnum & "'"
Set rstest = db.OpenRecordset(stdsql)
stDocName = "Sales Report supplier"
If Not rstest.EOF Then
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria
Else
vsupname = DLookup("[supname]", "[supplier]", "[supplierID] = "
& cmbSupSel & "")
stdmsg = "No data for Supplier '" & vsupname & "' at location '"
& VLocName & "'"
vres = MsgBox(stdmsg, vbInformation, "FILMS")
End If
rsloc.MoveNext
loop
Is there a way to be able to show each report separately? Or do I need to do
this some other way.

Thanks for any help.
 
R

Rick Brandt

CD said:
I have a location table with four locations, I've setup a report to
print by location, the code do a loop through the location table and
prints a separate for each location. When I set it up to do a
preview instead of printing I only get the first report Here's the [snip]
Is there a way to be able to show each report separately? Or do I
need to do this some other way.

I don't believe it is possible to simultaneously show the same report in
preview multiple times .
 
Top