Solved

print filtered or selected records

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

831 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