Solved

print filtered or selected records

Posted on 1998-08-12
3
290 Views
Last Modified: 2010-08-05
I was wondering if there was a way to print only records that were selected or based on a filter on the fly.  I want to be able to print either in report form or datasheet view specific records that have been filtered.  The best equivalent I could say would be in excel I was able to select 10 random records and print the selection.  Is something like this possible in access without actually going to the datasheet view and manually selecting the records?
0
Comment
Question by:popsicle
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
devtha earned 100 total points
Comment Utility
Build a form based upon a table and query that brings all records from that table and then
   attach this query to the report.
    On an openevent of the report apply filter.
   DoCmd ApplyFilter "Query_attached_toreport", "ssn =  forms![form_you_build]![ssn]"
   Select the record on the form and then click the button on the form that prints the report we
   are talking about.
0
 

Author Comment

by:popsicle
Comment Utility
This may be what I am looking for, i am not sure,i have a main form that I use to view and enter records. I want to be able to print from that form either the record I am currently viewing or all of the records that fit the filter that is currently on the form.  Does this do that?  If it does, could you be more specific about how.
0
 
LVL 6

Expert Comment

by:devtha
Comment Utility
Yes it will do it.
First when the report is opened it gets all the records that are available to it via the recordsource (query or table) QUERY in this case. Then we apply filter that gets the
value = to the value you provide from the form.
In my case
forms![form_you_build]![ssn]
In your case
forms![main]![ssn].

On the second thought what ever method you are using (query) fro viewing the records on the form then use the same query for the report and the on ONOpen event pase the code I have given you.

0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

8 Experts available now in Live!

Get 1:1 Help Now