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

QBF problem with multiple combo boxes


Here is my issue. I have created a form called “Search” that has several
unbound combo boxes, one for each of the attribute that match a column
in the Table [Movie Titles]. Each combo box has input from a separate
table that limits what the uses can select. IE. The Genre table feeds a
list of options for the Genre combo box.

My goal is to have the user select the attributes they want to use as
search criteria and then feed those selections from the combo boxes into
the query that is executed when you select the “Query” button action on
the form. The results could then either go to a subform within the main
Search form or a separate datasheet view that is generated based on the
Query results. How are fields that are left blank handled? If you can or
are willing to assist then please let me know. I can send a zip version
of the Access 2003 DB if you are able to assist.

Table Name = Movie Titles
TitleID
Title
Genre
Sub-Genre
Media
Etc… Several other attributes for each title.
Form for Query = Search
cbo_Title à gets Title from [Movie Titles] Table
cbo_Genre à gets Genre from Genre Table
cbo_Media à gets Media from Media Table

*** Sent via Developersdex http://www.developersdex.com ***
Dec 6 '05 #1
2 3997
normally, where you have optional search criteria, you can either do
something like

SELECT...
FROM...
WHERE MyField LIKE "*" & Forms!MySearchForm!MySearchField & "*"

or you can build the search string on the fly... Kind of depends on
where you're going to dump your resultset to. If you're sending it all
to a report, you can build your filter criteria on your form, and pass
the completed filter (basically the entire Where clause minus the
"WHERE" keyword) and then open the report. The report would be based,
in your case, on an unfiltered query that joined all the tables in the
query together.

Hope that helps a little.

Dec 8 '05 #2
Here is what I cam up with but I still have issues when one or more of
the combo boxes are left blank. Any help with this.
SELECT *
FROM [Movie Titles]
WHERE (Forms!Form1!cbo_title=[Movie Titles].Title Or [Movie
Titles].Title Is Not Null And Forms!Form1!cbo_genre=[Movie Titles].Genre
Or [Movie Titles].Genre Is Not Null And Forms!Form1!cbo_subgenre=[Movie
Titles].[Sub-Genre] Or [Movie Titles].[Sub-Genre] Is Not Null And
Forms!Form1!cbo_media=[Movie Titles].[Media Types] Or [Movie
Titles].[Media Types] Is Not Null And Forms!Form1!cbo_origin=[Movie
Titles].Origin Or [Movie Titles].Origin Is Not Null And
Forms!Form1!cbo_edition=[Movie Titles].Edition Or [Movie Titles].Edition
Is Not Null And Forms!Form1!cbo_awards=[Movie Titles].Awards Or [Movie
Titles].Awards Is Not Null And Forms!Form1!cbo_favorites=[Movie
Titles].Favorites Or [Movie Titles].Favorites Is Not Null And
Forms!Form1!cbo_lastuser=[Movie Titles].LastUser Or [Movie
Titles].LastUser Is Not Null And Forms!Form1!cbo_curruser=[Movie
Titles].UserIdCuruser Or [Movie Titles].UserIdCuruser Is Not Null);

*** Sent via Developersdex http://www.developersdex.com ***
Dec 8 '05 #3

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

Similar topics

2
by: MOHAMMED AZEEMUDDIN | last post by:
Hi, I''m looking for someone to help me out in ASP. I''ve 3 to 4 or more combo boxes. On the change event of the combo boxes I want to fill the values. Suppose I change the value in combobox1 the...
2
by: Megan | last post by:
Can you write conditional VBA code that affects only one or two records on a continuous subform? I have a form with a subform on it. The parent/ child field that links the forms is CaseID. The...
3
by: rquinnan | last post by:
Good Evening all, I would greatly appreciate any assistance on this Access 2003 quandary I'm in. And I do apologize if this has been answered somewhere else, I didn't see one that addressed my...
4
by: John Tyce | last post by:
The problem that I am now having, involves refreshing controls. I have allot of text boxes, several combo boxes and grids. These controls are showing live data from an Oracle database. I have dates...
6
by: zuchowra | last post by:
Hi everyone. I need help. I have a combo box in my form that i want to populate multiple text boxes after you select your selection in the combo box. Here is my set up. The Fields that need to be...
6
by: Dave | last post by:
On my form I have combo boxes. These combo boxes, after updating them, populate respective listboxes that are located below the combo boxes on the same form. I am trying to use a "generate...
4
by: SKelso | last post by:
I created a database in Access 2003 that contains an unbound search form with several combo boxes. Each combo box is populated with entries from the appropriate table. I want to allow the user to...
9
by: art | last post by:
Hi, We have some scripts here where we use some AJAX to populate some of the page. Basically the AJAX routine calls a PHP script. That PHP script uses a bunch of ECHO statements to create...
30
by: vanlanjl | last post by:
Question: How do I create a Report based off the values/selections of mutliple combo boxes in a form? I have tried this several times with several failures and have used multiple codes to try...
4
by: sree078 | last post by:
I've a list of items which I bound to multiple combo boxes. In the due course in the code...I had to add an item into one combo box...but I don't want it to be reflected into any other combo...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...

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.