Only filtered records in a report?

G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top