Only filtered records in a report?

P

P4Paul

I have created a report but only want it to display the currently filtered
records from the table and not the whole table.

Or... a prompt for the value in the field to be filtered and displaying
only those filtered records would work.
 
J

Jeff Boyce

If you are working in a form, display a "current" record (and you ARE using
a form to display records, right? -- tables store data, forms display it),
you can use a command button to add code that opens the report. The syntax
for this includes a variable you can use to filter...

DoCmd.OpenReport (see Access HELP for specific syntax)
 
D

Duane Hookom

As Jeff suggests, your records should be displayed in a form. You can then
use
Dim strWhere as String
strWhere = Me.Filter
DoCmd.OpenReport "rptYourReport", acPreview, , strWhere
 
Top