Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

print filtered or selected records

Posted on 1998-08-12
3
Medium Priority
?
298 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
devtha earned 200 total points
ID: 1958909
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
ID: 1958910
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
ID: 1958911
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

688 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