473,387 Members | 1,534 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Apply Filter to A Report

I already have a report designed under Reports. When I use filtering in Forms
or Tables, I see no way to select that filtered list when I am in Reports, and
there appears to be no way to do the filtering when I am in Reports.

I have received two replies to this message, posted a few days ago within
another Subject. One requires making programming type statements. That should
not be necessary -- Access must have a quick way to just click on something to
apply the filter to my already formatted report layout. The other reply said to
base the report on a query -- it appears to me I can only do that if I then
create a new report.

Thanks to anyone who can give me the simple instructions that must be in
Access, but sure are not in the Help menus.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #1
16 18350
On 11 Nov 2004 19:52:27 GMT, Nhmiller wrote:
I already have a report designed under Reports. When I use filtering in Forms
or Tables, I see no way to select that filtered list when I am in Reports, and
there appears to be no way to do the filtering when I am in Reports.

I have received two replies to this message, posted a few days ago within
another Subject. One requires making programming type statements. That should
not be necessary -- Access must have a quick way to just click on something to
apply the filter to my already formatted report layout. The other reply said to
base the report on a query -- it appears to me I can only do that if I then
create a new report.

Thanks to anyone who can give me the simple instructions that must be in
Access, but sure are not in the Help menus.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com

Are you using a form, and filtering the records using the "Filter by
Selection" or "Filter by Form" tool buttons?

If so, Add a command button to the form.
Code it's Click event:
DoCmd.OpenReport "ReportName", acViewPreview , , Me.Filter

Filter the records on the form, then click the button.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #2
>Are you using a form, and filtering the records using the "Filter by
Selection" or "Filter by Form" tool buttons?
Yes, Filter By Selection

If so, Add a command button to the form.
Code it's Click event:
DoCmd.OpenReport "ReportName", acViewPreview , , Me.Filter
My report is called Roster. Do I just substitute "Roster" for "ReportName"? I
tried that and nothing happened after I continued as below:

Filter the records on the form, then click the button.


Do you know what I did wrong? Also, how would anyone know to use a statement
like that? I'm surprised Microsoft does not have an easy way to accomplish this
task.

Thanks.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #3
>Are you using a form, and filtering the records using the "Filter by
Selection" or "Filter by Form" tool buttons?
Yes, Filter By Selection

If so, Add a command button to the form.
Code it's Click event:
DoCmd.OpenReport "ReportName", acViewPreview , , Me.Filter
My report is called Roster. Do I just substitute "Roster" for "ReportName"? I
tried putting the statement in the Event Tab but the characters wouldn't
appear.

Filter the records on the form, then click the button.


Do you know what I did wrong? Also, how would anyone know to use a statement
like that? I'm surprised Microsoft does not have an easy way to accomplish this
task. Perhaps if you could instruct me on this with me using the Wizard button
in conjunction with placing the Command button in my form, that might be
easier.

Thanks.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #4
On 11 Nov 2004 21:41:35 GMT, Nhmiller wrote:
Are you using a form, and filtering the records using the "Filter by
Selection" or "Filter by Form" tool buttons?


Yes, Filter By Selection

If so, Add a command button to the form.
Code it's Click event:
DoCmd.OpenReport "ReportName", acViewPreview , , Me.Filter


My report is called Roster. Do I just substitute "Roster" for "ReportName"? I
tried putting the statement in the Event Tab but the characters wouldn't
appear.

Filter the records on the form, then click the button.


** snipped **

When you have added the command button to the form, display it's
property sheet.
Click on the Event tab.
On the Click line write:
[Event Procedure]
Then click on the button with 3 dots that appears on that line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines, write:

DoCmd.OpenReport "Roster", acViewPreview , , Me.Filter

Exit the code window and save the changes.
Open the Form. Filter the records using one of the filter tool
buttons. Click the command button.
The Roster report will open, with just the filtered records.
--
Fred
Please only reply to this newsgroup.
I do not reply to personal email.
Nov 13 '05 #5
>** snipped **

When you have added the command button to the form, display it's
property sheet.
Click on the Event tab.
On the Click line write:
[Event Procedure]
Then click on the button with 3 dots that appears on that line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines, write:

DoCmd.OpenReport "Roster", acViewPreview , , Me.Filter

Exit the code window and save the changes.
Open the Form. Filter the records using one of the filter tool
buttons. Click the command button.
The Roster report will open, with just the filtered records.


Thank you. That worked. I gather there are several ways of accomplishing this
same task. An earlier reply on another Subject said to do it through a query.
What I am concerned about is how does a user, who expects Windows software to
be user friendly, know how to create code like yours? For comparison, the 1994
version of Lotus Approach requires nothing like this -- all tasks are done from
commands in dropdown menus, and apply universally to all views of a database.
Could you explain to me why Access is so code oriented? When I read the Help
topics, I have no clue what they are talking about or how to do what they are
saying. And I am a software engineer, though only as part of my work and on a
lower level.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #6
Nhmiller wrote:
** snipped **

When you have added the command button to the form, display it's
property sheet.
Click on the Event tab.
On the Click line write:
[Event Procedure]
Then click on the button with 3 dots that appears on that line.
When the code window opens, the cursor will be flashing between 2
already existing lines of code.
Between those 2 lines, write:

DoCmd.OpenReport "Roster", acViewPreview , , Me.Filter

Exit the code window and save the changes.
Open the Form. Filter the records using one of the filter tool
buttons. Click the command button.
The Roster report will open, with just the filtered records.

Thank you. That worked. I gather there are several ways of accomplishing this
same task. An earlier reply on another Subject said to do it through a query.
What I am concerned about is how does a user, who expects Windows software to
be user friendly, know how to create code like yours? For comparison, the 1994
version of Lotus Approach requires nothing like this -- all tasks are done from
commands in dropdown menus, and apply universally to all views of a database.
Could you explain to me why Access is so code oriented?


Flexibility. Expandability.

Many tasks are repetitious. Many aren't.
When I read the Help topics, I have no clue what they are talking about or how to do what they are
saying. And I am a software engineer, though only as part of my work and on a
lower level.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com

Nov 13 '05 #7
>DoCmd.OpenReport "Roster", acViewPreview , , Me.Filter

Would you be able to tell me where in Access (Help or otherwise) there is an
explanation of this command, and if there is a Help section with instructions
about writing code for the various needs you have run into? Thanks.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #8
nh******@aol.comnojunk (Nhmiller) wrote in message news:<20***************************@mb-m25.aol.com>...
I already have a report designed under Reports. When I use filtering in Forms
or Tables, I see no way to select that filtered list when I am in Reports, and
there appears to be no way to do the filtering when I am in Reports.

I have received two replies to this message, posted a few days ago within
another Subject. One requires making programming type statements. That should
not be necessary -- Access must have a quick way to just click on something to
apply the filter to my already formatted report layout. The other reply said to
base the report on a query -- it appears to me I can only do that if I then
create a new report.

Thanks to anyone who can give me the simple instructions that must be in
Access, but sure are not in the Help menus.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com


The other reply said to base the report on a query -- it appears to
me I can only do that if I then create a new report.

Not so. Create the query. Then change the 'Record Source' property of
the existing report to the name of the query.

HTH

Sunil Korah
Nov 13 '05 #9
>Create the query. Then change the 'Record Source' property of
the existing report to the name of the query.


I created the query using the query wizard. I selected all the fields, then did
a filter by selection on one of the fields. When I go to the report tab and
right click on the report name, then click on properties, there is just a
general tab and a window to enter descriptive information. Where is Record
Source? Thanks.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #10
Nhmiller wrote:
DoCmd.OpenReport "Roster", acViewPreview , , Me.Filter

Would you be able to tell me where in Access (Help or otherwise) there is an
explanation of this command, and if there is a Help section with instructions
about writing code for the various needs you have run into? Thanks.


Well...versions after A97 use a Help-less system. It's slow, impossible
to use, obtuse, unsorted, and generally considered crap by anyone with
an education above kindergarten. However, it is promoted by MS. It's
possible they are doing this to help in the sales of computer books.
It's also possible that the project managers at MS are satisfied with
second rate products or that few people ever complained to MS that their
help system is worth shit.

That being said, you should be able to search and find Docmd. Also,
OpenReport. or OpenForm. Be prepared to work harder and longer to find
information in the MS Help-less system. (How can a MS
help-documentation worker have any pride in this crap?)

If you can't find it in the MS Help-less (tm) system, you may need to
purchase/read a book on it. Quite a few books on Office are worthless too.


Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com

Nov 13 '05 #11
Nhmiller wrote:
Create the query. Then change the 'Record Source' property of
the existing report to the name of the query.

I created the query using the query wizard. I selected all the fields, then did
a filter by selection on one of the fields. When I go to the report tab and
right click on the report name, then click on properties, there is just a
general tab and a window to enter descriptive information. Where is Record
Source? Thanks.


You are looking at the properties of the report *document*. To see the
properties of the report *object*, it has to be open, in design view.
Click the Design button to do that.

I suggest you realize Access is difficult to use until you get a grasp
of its object model, and where to look for what. To get such a grasp,
digging into an existing application is a great step.

What version do you use? 97?
Nov 13 '05 #12
>Nhmiller wrote:
Create the query. Then change the 'Record Source' property of
the existing report to the name of the query.

I created the query using the query wizard. I selected all the fields, then

did
a filter by selection on one of the fields. When I go to the report tab and
right click on the report name, then click on properties, there is just a
general tab and a window to enter descriptive information. Where is Record
Source? Thanks.


You are looking at the properties of the report *document*. To see the
properties of the report *object*, it has to be open, in design view.
Click the Design button to do that.


I had tried that before, but now I see I have to right-click on the blue title
bar of the design window for the Properties to come up. As usual, the Help
menus do not tell you this -- Access' Help system is terrible. Once I am in the
Properties, I tried using the name of the query in Record Source. The problem
is I must not have created the Query correctly. In the Query section, a table
appears, the same as if I go to Table. I then did a Filter on Selection, but I
don't know how to save that so that when I go to Reports and enter the name of
the query in Record Source, I get the filtered records. Appreciate you
explaining what to do next. Thank you.


I suggest you realize Access is difficult to use until you get a grasp
of its object model, and where to look for what. To get such a grasp,
digging into an existing application is a great step.
Yes, I'm doing that, too. But, it's obvious that using the Help menus is of
very little use -- they are highly technical and code-oriented without any
explanations of how to learn and use the code. There should be a tutorial
and/or detailed examples of how to do at least the common operations. I am
surprised Microsoft gets away with this. I also have two books on Access
requested at our library -- I'll have those next week.

What version do you use? 97?


Office XP, which I think is also called Office 2002.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #13
>Nhmiller wrote:
Create the query. Then change the 'Record Source' property of
the existing report to the name of the query.

I created the query using the query wizard. I selected all the fields, then

did
a filter by selection on one of the fields. When I go to the report tab and
right click on the report name, then click on properties, there is just a
general tab and a window to enter descriptive information. Where is Record
Source? Thanks.


You are looking at the properties of the report *document*. To see the
properties of the report *object*, it has to be open, in design view.
Click the Design button to do that.


I had tried that before, but now I see I have to right-click on the blue title
bar of the design window for the Properties to come up. As usual, the Help
menus do not tell you this -- Access' Help system is terrible. I was able to
select the query, then change the No to a Yes to use the query, and it all
worked. Your method is better than another one described earlier in this
thread, as yours does not require any programming or coding -- the filter I use
in Query is saved and named, and available to use in the Report. Thank you.

I suggest you realize Access is difficult to use until you get a grasp
of its object model, and where to look for what.
It's only difficult to use because the Help menus give no explanation of how to
do the most simple tasks. I assume you learned how to do this from an earlier
version that had better Help, or from your own research, as I am doing.
To get such a grasp,
digging into an existing application is a great step.
Yes, I'm doing that, too. But, it's obvious that using the Help menus is of
very little use -- they are highly technical and code-oriented without any
explanations of how to learn and use the code. There should be a tutorial
and/or detailed examples of how to do at least the common operations. I am
surprised Microsoft gets away with this. I also have two books on Access
requested at our library -- I'll have those next week.

What version do you use? 97?


Office XP, which I think is also called Office 2002.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #14
Nhmiller wrote:
I had tried [viewing properties] before, but now I see I have to right-click
on the blue title
bar of the design window for the Properties to come up.
That is not the only way! There is a Properties item in the View menu;
there is a Properties button on the toolbar.
As usual, the Help
menus do not tell you this -- Access' Help system is terrible.
I suggest you examine whether your bad experience so far gets in the way
of your ability to look around. I must be honest to say I never have
used Access XP (so far) and hence I don't know a thing about its Help.
My experience with Access 97 is fine.

Maybe Microsoft documentation is not your thing. Learn it, then. I
understand you are seasoned in other environments, and I ensure you this
can be done.

I get the hint that you don't like the information sources, so far.
Please do not further mention this.

0> Once I am in the Properties, I tried using the name of the query in Record Source. The problem
is I must not have created the Query correctly. In the Query section, a table
appears, the same as if I go to Table. I then did a Filter on Selection, but I
don't know how to save that so that when I go to Reports and enter the name of
the query in Record Source, I get the filtered records. Appreciate you
explaining what to do next. Thank you.
A query is basically a stored SQL statement. For reports, the only
useful statement is SELECT because that returns records.
Such a query can contain any filter. When you have the query in Design
view, the filtering is displayed as criteria line(s). I believe the
interface is "Query By Example". When you have the query in SQL view,
the filtering is in the WHERE clause.

How familiar are you with SQL, actually?

To use a filter, you enter the corresponding expression in the correct
place, save the query--probably using a different name to indicate what
the query filters--and use that as recordsource for the report. I take
it you have noticed you can choose the recordsource from a dropdown list.
[...] using the Help menus is of very little use -- they are highly technical
and code-oriented without any
explanations of how to learn and use the code.
In my experience there are two environments of Help. The one is about
using Access, forms, controls, and whatsoever; the other is VBA help, so
for all coding issues. I do find the former helpful, whenever I don't
know exactly how to do something. To get the basic understanding,
however, one needs more information. You must have some general idea
where to go.
I am surprised Microsoft gets away with this.


That is all marketing.

Now, how about that Northwind sample I keep nagging about?
Nov 13 '05 #15
I revised the message you responded to, as I was successful using query and
report. I stated that your method works without resorting to codes constructed
by the user -- that's the way software should work. The old message must have
made it through to your newsgroup site anyway. I think it is important that we
express our opinions about product improvement -- Microsoft could have made
their Help section far better, but chose not to. One contributor to this thread
said it's because they want to sell books on using Office. If they are being
greedy, I think we should let them know. I'm lucky there's people like you
answering questions on newsgroups. I now have a good feel for how Access works.
Thank you.

Neil
Cat Paintings At Carol Wilson Gallery
http://www.carolwilsongallery.com
Nov 13 '05 #16
Nhmiller wrote:
I revised the message you responded to, as I was successful using query and
report. I stated that your method works without resorting to codes constructed
by the user -- that's the way software should work. The old message must have
made it through to your newsgroup site anyway.
Yes, I saw there was a second post. Only after I sent my reply.
I think it is important that we
express our opinions about product improvement -- Microsoft could have made
their Help section far better, but chose not to. One contributor to this thread
said it's because they want to sell books on using Office. If they are being
greedy, I think we should let them know.
Mmm, don't get me wrong: I fully agree. I suspect, though, that future
versions of Access will *not* contain all the good advice that the share
of users, among who those that visit these newsgroups, collects. Some
*does*. And there's no crying over spilled milk, version XP was released.

I'm lucky there's people like you answering questions on newsgroups. I now have a good feel for how Access works.
Thank you.


Any time, keep asking until everything works.
Nov 13 '05 #17

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: MaryD | last post by:
Is there any way to use the enter key - or a function key - as the Apply Filter when a form is opened in FilterByForm mode? I can see the value of function keys and the enter key when the form is...
4
by: Iyhamid | last post by:
Hi I am looking for codes to filter and apply filter to my data base using access
3
by: mattscho | last post by:
Hi All, Trying to create a set of 3 buttons in a form that have the same effect as the "Filter by Form", "Apply Filter" and "Remove Filter" Buttons on the access toolbar. Help would be muchly...
1
by: mattscho | last post by:
Re: Filter By From, Apply Filter, Remove Filter Buttons in a Form. -------------------------------------------------------------------------------- Hi All, Trying to create a set of 3 buttons in...
2
by: Nhoung Ar | last post by:
Can anybody out there help me please on apply filter in MS Access. I have a form that create from the query, which contain field chidid (text field), in the form footer, I add the button to open...
3
by: Supermansteel | last post by:
I am trying to run a Apply filter for everytime someone opens Form_CC it will only show the Test (Test_ID) they are working on. This seems to be the closest I have gotten to filtering it correctly,...
1
by: eHaak | last post by:
A couple years ago, I built a database in MS Access 2003. I built the form using macros in some of the command buttons, and now I’m trying to eliminate the macros and just use visual basic code. ...
3
by: dbdb | last post by:
hi guys need your suggestion how can i apply filter for my date variable data type i have a form name transaction and i have a text box on it named : start and finish i need to apply...
10
by: dbdb | last post by:
Hi, i create a chart in ms access based on my query, then i want my chart when is it open is only show value based on my criteria. i'll try to used it in the properties apply filter using the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.