A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Setting Up & Running Reports
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Filter a Report Using a Form's Filter



 
 
Thread Tools Display Modes
  #1  
Old January 8th, 2010, 06:41 PM posted to microsoft.public.access.reports
AMR
external usenet poster
 
Posts: 20
Default Filter a Report Using a Form's Filter

Hi,
i'm working on a payroll program
so i want to filter a report by building a form
filter by month ,city,site
but i want to know how i can set the properties of the form step by step !!
  #2  
Old January 8th, 2010, 07:19 PM posted to microsoft.public.access.reports
Duane Hookom
external usenet poster
 
Posts: 7,177
Default Filter a Report Using a Form's Filter

Is this a form or report question? Do you have any field names you can share?

Do you understand that your first step might be to create some combo boxes
that allow you to select a Month, City, and State?

If you have combo boxes, they should be given names like: cboMonth,
cboCity,....

--
Duane Hookom
Microsoft Access MVP


"amr" wrote:

Hi,
i'm working on a payroll program
so i want to filter a report by building a form
filter by month ,city,site
but i want to know how i can set the properties of the form step by step !!

  #3  
Old January 8th, 2010, 07:50 PM posted to microsoft.public.access.reports
Steve[_77_]
external usenet poster
 
Posts: 1,017
Default Filter a Report Using a Form's Filter

You probably want to filter your report by year also!

Presumably you have these two tables:
TblCity
CityID
City

TblSite
SiteID
Site

Your form, named ReportCriteria, needs four comboboxes. The first, cboCity,
has a rowsource of TblCity. The second has a rowsource of TblSite. The
third, cboYear, has a rowsource of a query that returns a list of the Years
in your TblPayroll. The fourth, cboMonth, has a value list fom 1 to 12.

You need a query that contains the fields, CityID, SiteID, Year([PayDate])
and Month([PayDate]).
The criteria for CityID needs to be:
Forms!ReportCriteria!cboCity

The criteria for SiteID needs to be:
Forms!ReportCriteria!cboSite

The criteria for Year([PayDate]) needs to be:
Forms!ReportCriteria!cboYear

The criteria for Month([PayDate]) needs to be:
Forms!ReportCriteria!cboMonth

Set the recordsource of your report to this query.

Finally, you need a button on ReportCriteria that opens your Report. You
need code in the click event of he button that first checks to see if all
comboboxes have a value and then if they do, opens the report.

Steve



"amr" wrote in message
...
Hi,
i'm working on a payroll program
so i want to filter a report by building a form
filter by month ,city,site
but i want to know how i can set the properties of the form step by step
!!



  #4  
Old January 10th, 2010, 11:58 PM posted to microsoft.public.access.reports
Armen Stein[_2_]
external usenet poster
 
Posts: 157
Default Filter a Report Using a Form's Filter

On Fri, 8 Jan 2010 10:41:01 -0800, amr
wrote:

so i want to filter a report by building a form
filter by month ,city,site
but i want to know how i can set the properties of the form step by step !!


You've gotten a couple of other responses, but I wanted to suggest
doing it a different way. Instead of the form calling the report,
have the report call the form. Here are some details:

To have a report prompt the user for criteria before it runs, open a
form from the report's Open event. Open the form in Dialog mode so
that the report waits for the form to be closed or hidden before it
proceeds. That way you can collect criteria from the user and build a
Where clause for the report. It also means that you can call the
report directly - you don't need to call it from a form. And the
selection form is reusable - it can be called from multiple reports if
they need the same criteria.

I've posted examples of this technique on our J Street Downloads page
at http://ow.ly/M58Y
See "Report Selection Techniques".

Armen Stein
Microsoft Access MVP
www.JStreetTech.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:49 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.