473,396 Members | 2,013 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.

Multiple Search Criteria

TH
I am (still :) working on a recipe database. Now I am trying to figure out
how to set it up for an ingredient search. What I want it to be able to do
is three things:
1. Search based on just one ingredient
2 Search based on two ingredients so that the recipe would have to have
both ingredients to show up in the results
3. Search based on three ingredients so that the recipe would have to
have all three ingredients to show up in the results.
Doing just one ingredient is easy. It's when I get to two and three that I
have a problem. The thing is there won't always be a second and third
ingredient to search on. It will depend on how the user wants to search.

I have the database set up with multiple tables. A couple of these include
one for all the details related to the recipe and one for the ingredients
specific to the recipe. These two tables have a one to many relationship
and the join type is to include records where the joined fields from both
tables are equal. I was thinking of using queries but I can't figure out
the logistics of it so it will perform the three things above. I can get it
to where it shows recipes that have say apples or strawberries. When I put
these two on the same line to create an And criteria I get no results even
though there are recipes fitting those criteria. Is it looking for both of
these to be in the same record, same field? How do I get it to look through
all of the ingredients for a particular recipe so it does what #2 and #3
above indicate?

Thank you for your time to anyone who is able to answer. I just have no
idea how to do this.

Tonye

Nov 12 '05 #1
1 8750
Create a form "IngredientCRForm" with 3 combo boxes "Combo1", "Combo2",
"Combo3" each listing all the ingredients. The source for each combo will
be the same...the ingredients. You can use whatever form and field name you
want.

Then in a query list the ingredients a field and on 3 SEPARATE CRITERIA
LINES enter:
Like "[forms]![IngredientCRForm]![Combo1]" & "*"
Like "[forms]![IngredientCRForm]![Combo2]" & "*"
Like "[forms]![IngredientCRForm]![Combo3]" & "*"

These are OR statements and therefore if the user does not choose any
ingredient, the system will retieve all recipes. Otherwise it will just
recall 1, 2 or 3 ingredients listed. You can uses as many ingrediens as you
want.

Hope this helps
Paul

"TH" <ni*******@bluefrog.com> wrote in message
news:bl*********@enews4.newsguy.com...
I am (still :) working on a recipe database. Now I am trying to figure out
how to set it up for an ingredient search. What I want it to be able to
do
is three things:
1. Search based on just one ingredient
2 Search based on two ingredients so that the recipe would have to
have
both ingredients to show up in the results
3. Search based on three ingredients so that the recipe would have to
have all three ingredients to show up in the results.
Doing just one ingredient is easy. It's when I get to two and three that
I
have a problem. The thing is there won't always be a second and third
ingredient to search on. It will depend on how the user wants to search.

I have the database set up with multiple tables. A couple of these
include
one for all the details related to the recipe and one for the ingredients
specific to the recipe. These two tables have a one to many relationship
and the join type is to include records where the joined fields from both
tables are equal. I was thinking of using queries but I can't figure out
the logistics of it so it will perform the three things above. I can get
it
to where it shows recipes that have say apples or strawberries. When I
put
these two on the same line to create an And criteria I get no results even
though there are recipes fitting those criteria. Is it looking for both of
these to be in the same record, same field? How do I get it to look
through
all of the ingredients for a particular recipe so it does what #2 and #3
above indicate?

Thank you for your time to anyone who is able to answer. I just have no
idea how to do this.

Tonye

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Gobi | last post by:
Hello, I have a Database with lists of Clients in each. Every year a new tables is created with the naming convention "CloseYear" ie close1999, close2000 There are tables from this year back to...
1
by: Roy | last post by:
I'm assuming this is amazingly simple and I'm just missing the boat. On the html side of an asp.net page I have a datagrid, a "search" button, and 8 text boxes for search criteria. A user enters...
6
by: shantanu | last post by:
Hi All, I have a requirement to develop a search engine based on some search criteria that will search for the string or statement in all the documents uploaded in the website. The search result...
3
by: AishaKhalfan | last post by:
Hi, :wave: I have many search criteria in my program, such as: search by name, search by age, search by gender, search by city the user can search by name only, or by name and age, or by...
5
by: mforema | last post by:
Hi Everyone, I want to search records by typing in multiple keywords. I currently have a search form. It has a combo box, text box, Search command button, and a subform. The combo box lists the...
1
by: Kye | last post by:
It has been a while since using vb an now I have started a project and I am not sure where my mistake is in my code. Basically what I am doing is trying to build a multiple search string with...
49
by: martin DH | last post by:
Hello all, I'm back with another SQL related problem. The details are below, but in short: I am using Access 2003. I have a table whose structure may include four different associate names per...
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...
5
Frinavale
by: Frinavale | last post by:
I'm playing with an ASP.NET MVC application and I've run into a bit of a problem. I am pretty new to ASP.NET MVC and just barely understand the basics to get things to work at this point. I have a...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.