By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,354 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

Add filter to row source query of list box?

P: 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

May 29 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On May 29, 9:54 am, lorirobn <lorir...@yahoo.comwrote:
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

May 30 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.