473,288 Members | 1,693 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,288 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 3991
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: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

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.