473,414 Members | 1,663 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,414 software developers and data experts.

Multiple Searches

65 64KB
As a part of the database I am developing I ran into a tricky Situation. Would be great if anyone could Show me the right way to proceed.
It is regarding a search function.

I will try my best to give a good Explanation.
so I have:
3 tables completely different except one common field [pnr]
1 form.

in this form I have 2 Combo boxes and one TextBox.
The first Combo box (COMBO1) has the 3 table names,
the second Combo box (COMBO2) Shows the field names of the selected table in COMBO1
and the TextBox (TEXT1) allows the user to enter a value.
on clicking search the value has to be searched and deposited in a new table (TABLESEARCH) for the user to view.
all the values are searched, I use (*).
Till here I am able to do it. No Problems.

The Twist in the Problem starts here.
My users would like to have a Kind of multiple searches.
that means, I put in 3 more sets of (COMBO1+COMBO2+TEXT1).
each time one set is filled there is a command button and a new set will appear if the user wants.

now the search has to work like this.
the user can enter the first set of Parameters into (COMBO1 +COMBO2 +TEXT1).
it searches and Shows in TABLESEARCH.
now when a new set of Parameters are entered, the second search has to take place in the result of the first search.
this is what makes it difficult for me.

and to make it even more difficult, as i mentioned at the start I have three tables,
lets say, the user selects a new table (TABLENEW) for the second search then the search result has to get added into the first search result table (TABLESEARCH).
so the resulting [pnr] from the first search (TABLESEARCH) has to be searched in the new table (TABLENEW) and the results added to the first search result table (TABLESEARCH).
that means new fields from TABLENEW have to be added into the first search result table (TABLESEARCH).

I hope i was not too confusing. I have no idea how to do this. I am not even sure if it can be done.
Can someone please tell me my Options or maybe some modifications can be also made.

Thanks as always..
Mar 9 '16 #1
1 1236
zmbd
5,501 Expert Mod 4TB
Let's see if we understand this... it sounds like you are building a cascading filter along the same lines as one sees on the shopping websites
All Products>Clothing>Men's>Shoes>Company>Size13US>Blu e>Running>Minimalist

However, you have the three tables... just a little twist...

but lets verify that my logic is matching yours

+ You have TableA, TableB, and TableC

+ You have a common field [PNR] such that:
[TableA]![PNR]==[TableB]![PNR]==[TableC]![PNR]

(?) How are you ensuring that this relationship holds true?

+ If a user selects from CBO1_Tables, CBO1_Fields has the fields that are in the design of the table selected.

++ You have a TextBox1 that the user enters the search criteria.

+++ using these three controls you can create the SQL-WHERE clause such (this isn't the properly formatted string just symbolic)
WHERE ([CBO1_Tables]![CBO1_Fields]=[TextBox1]);

IE user slects:
CBO1_table=[TableA]; CBO1_Field=[Filed1]; TextBox1="Value"
[iCODEWHERE ([TableA]![Fields1="Value");[/icode]
Such that you get records so that:
record set = [TableA][PNY]={1,2,3,4}

++ You are appending the resulting query results to another table (?)

You might want to consider creating a secondary database "on the fly" at the user's pc for this to avoid bloating your main user interface or the back-end file(s)

+ The subsequent searches are to be restricted to where only the records in the prior search with the same [PNY] in all the tables are available for the subsequent searches:

Using the example return above the second search is based on:
Expand|Select|Wrap|Line Numbers
  1. Record set =
  2. ([TableA]![PNY]= 1,2,3,4)
  3.    ===([TableB]![PNY]= 1,2,3,4)
  4.       ===([TableC]![PNY]= 1,2,3,4
If the user's selections are that you get something like:
Expand|Select|Wrap|Line Numbers
  1. Record set =
  2. ([TableA]![PNY]= 1,2)
  3.    ===([TableB]![PNY]= 1,2)
  4.       ===([TableC]![PNY]= 1,2
for the return record you would base a third set of search criteria on the above records etc...

(?) You say that you want to append the results from each sub-record-set into the holding table - how do you handle situations where the user reselects the same table, field, and value as in the first search?

so is this correct?
May 6 '16 #2

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

Similar topics

0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
0
by: Web Science | last post by:
Site and Features: http://www.eigensearch.com Search engine, eigenMethod, eigenvector, mathematical, manifolds, science, technical, search tools, eigenmath, Jacobian, quantum, mechanics,...
5
by: whitsey | last post by:
Here is what I have: SELECT (SELECT COUNT(*) AS SEARCHES FROM SEARCHES INNER JOIN GROUPS ON SEARCHES.SITE_ID = GROUPS.SITE_ID WHERE
32
LeighW
by: LeighW | last post by:
Hi, I'm still having a couple problems with searches. I have a search form, frm_Search. The form I am trying to filter, frm_Form1 An unbound combobox on frm_Search, Cbo_Permit 6 different...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...

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.