473,396 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with using a subquery to filter on multiple tables using a single form

6
Hi all--
Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only allows me to filter based on variables in a single table. I would like to have a search form where I can select multiple variables (from various linked tables) to filter by, and return results based on this multi-table filter.

Allen Browne has a wonderful description of how to create a simple search form: <http://www.allenbrowne.com/ser-62.html>, and he even alludes to a way "to filter on other tables that are not even in the form's RecordSource, use a subquery" -- on his subquery page (<http://www.allenbrowne.com/subquery-01.html#Search>), he describes using subqueries in the context of his simple search form to create a search form "where the user can select criteria based on any related table in the whole database". I was wondering if anyone had some thoughts as to how I might actually code something like that.

Thanks,
-Jason
Dec 20 '07 #1
3 2692
Denburt
1,356 Expert 1GB
Maybe you could supply a listbox that lists all the tables in the DB then choose a table to search by. Once the table is chosen you can use that table name in the search query.

Another possible method would be to create a union query containing the field you want to search from each of the tables you want searched, from there you can use sourcetable or something to retrieve the table name.

Does this help?
Dec 21 '07 #2
jcf378
6
thanks for your input...i'm still fuzzy having trouble figuring out how I would display results on a single page that were inclusive of all the fields (across the various tables) that were searched...

--jason
Dec 22 '07 #3
Denburt
1,356 Expert 1GB
Back from the holidays. If the tables contain contain the same number of fields containing the same data such as multiple archived tables or something then I would use a Union query for what you are asking. then you can base a form or subform on these results.

Select field1, field2 from Table1
Union Select field1, field2 from Table2
Dec 27 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
5
by: Steve Patrick | last post by:
Hi All You guys are my last hope, despite spending money on books and hours reading them I still can not achieve the results I need. I have designed a database in Access 2000 based on 1 table,...
7
by: Jeff | last post by:
Hi - For my VB.NET app, I have a SQL2K database that I use to create a dataset with multiple data tables. I've created a dataview (dvReportsTo) of one of the tables, SCPMaster, and I've bound a...
0
by: lordofhyphens | last post by:
I'm trying to form a correlated subquery (right now, it's MS Access running to linked tables in MS SQL, although I have tried to make the same query against the MS SQL tables directly). The goal...
0
by: anonieko | last post by:
This approach I found very efficient and FAST when compared to the rowcount, or Subquery Approaches. This is before the advent of a ranking function from DB such as ROW_NUMBER() in SQL Server...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
0
debasisdas
by: debasisdas | last post by:
Using Subqueries ================== The sub query is often referred to as a nested SELECT, Sub - SELECT, or inner SELECT statement. The sub query executes once before the main query. The...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
8
by: Sham | last post by:
I am trying to perform the following query on a table that has been indexed using Full Text Search. The table contains multiple columns than have been indexed. (Below, all xml columns are...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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...

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.