[AccessD] Filtering, generalized v. specific solution - was ""

Wortz, Charles CWortz at tea.state.tx.us
Wed Jul 30 13:57:34 CDT 2003


Scott,

I was giving Frank a generalized solution to his problem, not a specific
solution.  If there are three or more ways to filter the form then the
generalized solution is almost as easy as the specific solution.

With the generalized solution you can give the user as many options as
you can fit on the search form.  The search form I currently have can
allow up to 13 different variables in the filtering search.  It could
handle more if I let the form be scrollable.  In the several years I
have used this search form I have yet to have a user ask for a 14th
variable.  For most of the forms I use this search form with have less
than ten variables to filter on.

Charles Wortz
Software Development Division
Texas Education Agency
1701 N. Congress Ave
Austin, TX 78701-1494
512-463-9493
CWortz at tea.state.tx.us



-----Original Message-----
From: Marcus, Scott (GEAE, Contractor) [mailto:scott.marcus at ae.ge.com] 
Sent: Wednesday 2003 Jul 30 13:16
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] 
Importance: Low


Charles,

Why not add the filter to the report? All the filter is, is the 'where
condition' minus the word 'where'. This would save making a Query (even
if it is temporary).

Just curious.

Scott

-----Original Message-----
From: Wortz, Charles [mailto:CWortz at tea.state.tx.us]
Sent: Wednesday, July 30, 2003 2:05 PM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] 


Frank,

I solved a similar problem by building a search form where the user
selected one or more of the variables they wanted to search on, the
appropriate operator (=, >, IsNull, Between, etc.) for each variable,
and the value(s) to use with that variable.  When they clicked on the OK
button, I then edited the selections and built the sql to use as the
recordsource of the form they wanted to filter.  It is a little work to
build such a search form, but once you have one it is easy to adapt to
the next form that needs a variable filter.

Charles Wortz
Software Development Division
Texas Education Agency
1701 N. Congress Ave
Austin, TX 78701-1494
512-463-9493
CWortz at tea.state.tx.us



-----Original Message-----
From: Marcus, Scott (GEAE, Contractor) [mailto:scott.marcus at ae.ge.com] 
Sent: Wednesday 2003 Jul 30 10:33
To: 'Access Developers discussion and problem solving'
Subject: RE: [AccessD] 

In that case, you need to set the 'filter on' property of the report to
true. Next, set the filter to the where condition of the SQL statement
that you would have if you knew all the criteria up front without the
word 'where'.

for example...
Me.FilterOn = true
Me.Filter = "[field] = 'something' and [filed2] = 'something else'"

Scott

-----Original Message-----
From: Frank Tanner III [mailto:pctech at mybellybutton.com]
Sent: Wednesday, July 30, 2003 11:23 AM
To: Access Developers discussion and problem solving
Subject: RE: [AccessD] 


I thought of that.  My biggest problems is that It may
need to be based on more than one of the filter
queries at a time.  Like I might want to filter out
extension to extension calls AND local calls so that
they're not displayed on the report.

--- "Marcus, Scott (GEAE, Contractor)"
<scott.marcus at ae.ge.com> wrote:
> In the Open event of the report, determine which
> query the report needs to
> be based on(the form check boxes) and change the
> recordsource via code.
> 
> Scott
> 
> -----Original Message-----
> From: Frank Tanner III
> [mailto:pctech at mybellybutton.com]
> Sent: Wednesday, July 30, 2003 10:57 AM
> To: Database Advisors
> Subject: [AccessD]
> 
> 
> Ok.  Stupid question time....hehehe
> 
> I have a report that I want to run.  The report, of
> course, is based on a query (it calls the query as
> it's record source).  I have other queries that I am
> using as "filters".  I want to activate these
> filters
> based on check/uncheck boxes.
> 
> I have the check/uncheck boxes on a form.  The form
> calls the report.  How can I get the report to
> filter
> based on the "filter" queries I have written based
> on
> whether or not a checkbox is checked or unchecked in
> the main form?
> 
> Thank you for your assistance.
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list