Solved

MS Access 2007 Multiple Filter onLoad

Posted on 2009-05-14
5
784 Views
Last Modified: 2013-11-28
Simple request.
How can you add multiple filters to a MS Access 2007 report.
I have 2 fields:
1: Print (TRUE/FALSE)
2: Select Type (TypeA, TypeB)

I want to do a simple filter when loading a report that only displays the values WHERE
[Print] = "TRUE" and [Select Type] = "TypeA"

How can I simply do this?
0
Comment
Question by:vmurray
  • 3
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
noetymology earned 500 total points
ID: 24388499
Use the recordsource of the report as
SELECT Table1.EName, Table1.Print, Table1.[Select Type]
FROM Table1
WHERE (((Table1.Print) Like "True") AND ((Table1.[Select Type]) Like "Type A"));
0
 
LVL 5

Expert Comment

by:noetymology
ID: 24388515
I have used Select Type as "Type A" with a space. You have used it without a space. So you might have to make those changes
0
 

Author Comment

by:vmurray
ID: 24388775
Didn't really get it from the query statement code... but "use the recordsource of the report" did it for me.

I ended up going to the report properties, clicking on "Record Source, ..." and adding each field.  I then added "Criteria" to the 2 fields...

ie: TRUE and "TypeA"

It automatically added the statement to the Record Source along with the selected table.  

There are too many ways to do 1 task in Access... but this is from someone who doesn't use it much.  Thanks.
0
 

Author Closing Comment

by:vmurray
ID: 31597509
The key was "recordsource of the report"... Thanks.
0
 
LVL 5

Expert Comment

by:noetymology
ID: 24388856
That is true. You could also first create a query and then use it as a recordsource for your report. Or you can use the above select statement directly as the recordsource of the report. You could also invoke the query builder by clicking on the ellipse on the recordsource property and then design the same query from the query grid. So yes there are many ways to do one task. Good Luck!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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 …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

837 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