473,563 Members | 2,722 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

May 29 '07 #1
1 8771
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1710
by: chrisse | last post by:
Hey, I'm having quite a bit of trouble trying to filter through a list using a text box and multiple combo boxes. When you write anything in the text box the list goes blank. Although when you select something from one of the combo boxes nothing happens at all. Help will be greatly appreciated.
1
1902
by: Jean | last post by:
Hi, I think this is quite a simple one: I have a ComboBox, where the source is a stored query. When I click the drop-down arrow on the Box, it takes awhile. I want to run this query in the background when the form opens, so that when I click the dropdown, it is ready. How?
1
3512
by: Steve | last post by:
Hi, I want to get a list of files in a directory, but I want to filter the list to *.vb, for example. If I use a straight forward Directory.GetFileSystemEntries(path, "*.vb") I get the filenames but also the path. I can use FileInfo with DirectoryInfo to just get the Filenames, but I get
4
1729
by: Les Stout | last post by:
Hi all, i am a newbie trying to have a map of South Africa with the various Provinces (States) and want to click on one and them to open a report for that selection, using the clicked area as the filter criteria for the query, or must one make a query for each province ?? Thanks in advance for any help Les Stout *** Sent via...
2
19456
by: espositozero | last post by:
Hello... I'm REALLY new to this whole thing, so if you all don't mind speaking in lamens terms for me... What I want to do seems like it should be simple, but I've been searching everywhere and I can't come up with anything. Here's the deal. I have 4 categories in a table, one of which is "products" where there are multiple entries, I want...
2
1697
by: doctorfeelyg | last post by:
Hi there, I’m relatively new to access so please forgive any ignorance. Here is my, rather long-winded, plea for help: I have a main table which contains a list of ‘projects’ and associated information (team name, staff member dealing with a particular project, project description, budget etc). Team names and staff names are stored in...
5
42414
by: jamesnkk | last post by:
I have a listbox which show customer Names on the 1st column and PO numbers on the 2nd column. When user select the customer and press the OK button, it will access to the PO form. Problem here is the list will grow longer and longer and I need to scroll up and down to look for the correct PO. I would like to create a textbox below the...
5
3330
Jerry911
by: Jerry911 | last post by:
Hi, I have a query that I use to export data to a spreadsheet. The query itself works fine and I can manually edit the query to supply filtered information. What I would like to do is use a form that has several filter options so I do not have to modify my query every time I run it. I have a form with a list box to define one of the filters...
14
18255
by: mjvm | last post by:
HI, I have had a search for the answer to this question, but I can't transfer what I am reading to my database. I don't know enough about the language required, but have been able to get my database to do what I want by following your instructions! I want to filter a drop down list based on the entry of another field - which is also a lookup...
0
7882
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8103
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7634
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2079
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
916
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.