Connecting Tech Pros Worldwide Help | Site Map

Add filter to row source query of list box?

 
LinkBack Thread Tools Search this Thread
  #1  
Old May 29th, 2007, 02:55 PM
lorirobn
Guest
 
Posts: n/a
Default Add filter to row source query of list box?

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, 02:45 AM
lgeastwood@gmail.com
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.