Solved

print filtered or selected records

Posted on 1998-08-12
3
292 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
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Single Step Macro 4 40
Adding new field to an existing database in access 3 24
UK Date format in MS Access 4 20
Access Schema 6 23
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

792 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