I need to provide the user the capability, from menu choices, to print either
one page of a mailing label report or the entire report. I have made a second
query for the report that produces only the top 30 records (one page). I am
using the following code to produce the full report:
DoCmd.OpenReport "rptStickerLabels", acViewNormal, "qryStickersMail"
When I substitue the following, the report still prints out in its entirety:
DoCmd.OpenReport "rptStickerLabels", acViewNormal, "qryStickersTestPrint"
The query in the last line is the same as the first except that it calls for
the top 30 records.
How can I make this work? Or is there a better way?
Thak you for your considration.
Ken Snell (MVP) - 15 Dec 2006 03:13 GMT
Generally it's better to use the "Where" argument (the fourth argument) of
the DoCmd.OpenReport method for providing a filter to the report. Base the
report on a query that returns all records, then you can pass a string that
represents the WHERE clause of an SQL statement to the report in that
argument.
DoCmd.OpenReport "ReportName", acViewNormal, , "FieldName=SomeValue"
See Help file for more info, or post back with questions.

Signature
Ken Snell
<MS ACCESS MVP>
>I need to provide the user the capability, from menu choices, to print
>either
[quoted text clipped - 12 lines]
> How can I make this work? Or is there a better way?
> Thak you for your considration.