Connecting Tech Pros Worldwide Help | Site Map

Add filter to row source query of list box?

  #1  
Old May 29th, 2007, 03:55 PM
lorirobn
Guest
 
Posts: n/a
Hi,

I have a list box on a form, whose row source points to a separate
query. The query refers to a field on the form to filter records on
the list box, like such: WHERE tblA.DesignType = [Forms]![frmForm1]!
[txtDesignType]).

Now I want to put this list box on a second form. Rather than create
a second query that would reference a field on the second form, I want
to try to use the same query, and make it generic.

Is there a way to do this?

Can I take off the WHERE clause from the query, and put it somewhere
on the form? In other words, can I filter the query by adding a
filter to each of these two forms, to filter the list box?

I know I could put the query's SQL directly into the row source of the
form, but because it joins about 6 tables, I'd prefer to keep it
separate and easier to read.

Thanks in advance..
lorirobn

  #2  
Old May 30th, 2007, 03:45 AM
lgeastwood@gmail.com
Guest
 
Posts: n/a

re: Add filter to row source query of list box?


On May 29, 9:54 am, lorirobn <lorir...@yahoo.comwrote:
Quote:
Hi,
>
I have a list box on a form, whose row source points to a separate
query. The query refers to a field on the form to filter records on
the list box, like such: WHERE tblA.DesignType = [Forms]![frmForm1]!
[txtDesignType]).
>
Now I want to put this list box on a second form. Rather than create
a second query that would reference a field on the second form, I want
to try to use the same query, and make it generic.
>
Is there a way to do this?
>
Can I take off the WHERE clause from the query, and put it somewhere
on the form? In other words, can I filter the query by adding a
filter to each of these two forms, to filter the list box?
>
I know I could put the query's SQL directly into the row source of the
form, but because it joins about 6 tables, I'd prefer to keep it
separate and easier to read.
>
Thanks in advance..
lorirobn
put your textbox on a "common" form that you always have open and
update it as required for your filter. remember to requery the active
listbox

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Data Field As The Rowsource For A Combo Box Wayne answers 4 November 3rd, 2007 09:25 PM
filter combo box to show unique names in linked table banderson answers 2 October 19th, 2007 02:04 PM
Next problem - access to recognise appointment clashes keri answers 4 December 5th, 2006 08:35 PM
List Box on Form Jonny answers 5 November 13th, 2005 12:55 AM