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

Combo Box complications

I wasn't sure how to search for previous posts about this, it felt
real specific. Ok so here's the database & problem:

I have 4 combo boxes: cboServer, cboPolicy, cboDB, and
cboApplication. The idea behind the database is for a user to search/
select desired information in any kind of combination between the 4
combo boxes. Then the user clicks a button (btnSearch) and
subsequently a query ("Search Function") is run that shows all 4
different data selections from the 4 combo boxes.

Right now if a user selects something from EACH (all 4) combo box and
runs the search, it works fine (all 4 selections are displayed in
their respective columns).

Here's the issue: If the user selects information from only 3, 2, or
1 combo box(es) (not all 4), then the "search" returns nothing at
all. What it should return is a selection from all 4 combo boxes
(i.e. if a user selects a database from cboDB, clicking the search
button should return the Database previously selected as well as the
Server and Policy it resides on, and the Application that runs the
Database.) Depending on the combo box data that is selected by the
user, clicking the search button will find the rest of the data that
is related to the data that was selected by the user previous to
clicking search.

Maybe I'm just having a Friday brain fart, but any help on getting
this working right is much appreciated!! Thanks in advance,

Dave

Jun 29 '07 #1
4 2334
Assuming your form with the comboboxes is named FrmSearch, put the following
expression in the Server field of your query:
Forms!FrmSearch!cboServer Or (Forms!FrmSearch!cboServer Is Null)

Use a similar expression for the other three comboboxes.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
re******@pcdatasheet.com


"Dave" <dj*******@gmail.comwrote in message
news:11*********************@c77g2000hse.googlegro ups.com...
>I wasn't sure how to search for previous posts about this, it felt
real specific. Ok so here's the database & problem:

I have 4 combo boxes: cboServer, cboPolicy, cboDB, and
cboApplication. The idea behind the database is for a user to search/
select desired information in any kind of combination between the 4
combo boxes. Then the user clicks a button (btnSearch) and
subsequently a query ("Search Function") is run that shows all 4
different data selections from the 4 combo boxes.

Right now if a user selects something from EACH (all 4) combo box and
runs the search, it works fine (all 4 selections are displayed in
their respective columns).

Here's the issue: If the user selects information from only 3, 2, or
1 combo box(es) (not all 4), then the "search" returns nothing at
all. What it should return is a selection from all 4 combo boxes
(i.e. if a user selects a database from cboDB, clicking the search
button should return the Database previously selected as well as the
Server and Policy it resides on, and the Application that runs the
Database.) Depending on the combo box data that is selected by the
user, clicking the search button will find the rest of the data that
is related to the data that was selected by the user previous to
clicking search.

Maybe I'm just having a Friday brain fart, but any help on getting
this working right is much appreciated!! Thanks in advance,

Dave

Jun 29 '07 #2
On Jun 29, 3:56 pm, Dave <djwest...@gmail.comwrote:
I wasn't sure how to search for previous posts about this, it felt
real specific. Ok so here's the database & problem:

I have 4 combo boxes: cboServer, cboPolicy, cboDB, and
cboApplication. The idea behind the database is for a user to search/
select desired information in any kind of combination between the 4
combo boxes. Then the user clicks a button (btnSearch) and
subsequently a query ("Search Function") is run that shows all 4
different data selections from the 4 combo boxes.

Right now if a user selects something from EACH (all 4) combo box and
runs the search, it works fine (all 4 selections are displayed in
their respective columns).

Here's the issue: If the user selects information from only 3, 2, or
1 combo box(es) (not all 4), then the "search" returns nothing at
all. What it should return is a selection from all 4 combo boxes
(i.e. if a user selects a database from cboDB, clicking the search
button should return the Database previously selected as well as the
Server and Policy it resides on, and the Application that runs the
Database.) Depending on the combo box data that is selected by the
user, clicking the search button will find the rest of the data that
is related to the data that was selected by the user previous to
clicking search.

Maybe I'm just having a Friday brain fart, but any help on getting
this working right is much appreciated!! Thanks in advance,
You could always force the user to choose something by checking the
value of each combobox from your search button, e.g.

If isnull(cbo1) or isnull(cbo2) or isnull(cbo3) or isnull(cbo4) then
MsgBox "You must choose a value in all drop down lists."
Exit Sub
End If

Bruce

Jun 29 '07 #3
Steve, thank you for your help! What you said to do works...however,
the expression for displaying all fields in the results doesn't fully
function.

If I choose 1 of the 4 combo boxes, it now works like a charm. It
brings up every specific instance that is tied to that one selected
combo box value. However, if I select, for example, an instance from
the Server and the Policy combo boxes, the results bring up ALL
instances of the server in ALL policies.

What it needs to do is if I choose two instances (one server in the
combo box and one policy that it resides on), it displays only that
one policy and only that one server (along with whatever databases and
applications are running on the selected server & policy).

So again, to reiterate/clarify, the problem is if I choose something
from both the Server and the Policy combo boxes and click search, it
brings up all Servers on the selected policy as well as all policies
that deal with the Selected server (many servers and many policies).
So instead I need it to give me the one server residing on the one
selected policy (along with DB and app info tied to the server
selected).

I don't think it is my normalization, but I guess it is possible.
Thanks again in advance...this forum is very helpful,

Dave

On Jun 29, 4:14 pm, "Steve" <s...@private.emailaddresswrote:
Assuming your form with the comboboxes is named FrmSearch, put the following
expression in the Server field of your query:
Forms!FrmSearch!cboServer Or (Forms!FrmSearch!cboServer Is Null)

Use a similar expression for the other three comboboxes.

PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resou...@pcdatasheet.com

"Dave" <djwest...@gmail.comwrote in message

news:11*********************@c77g2000hse.googlegro ups.com...
I wasn't sure how to search for previous posts about this, it felt
real specific. Ok so here's the database & problem:
I have 4 combo boxes: cboServer, cboPolicy, cboDB, and
cboApplication. The idea behind the database is for a user to search/
select desired information in any kind of combination between the 4
combo boxes. Then the user clicks a button (btnSearch) and
subsequently a query ("Search Function") is run that shows all 4
different data selections from the 4 combo boxes.
Right now if a user selects something from EACH (all 4) combo box and
runs the search, it works fine (all 4 selections are displayed in
their respective columns).
Here's the issue: If the user selects information from only 3, 2, or
1 combo box(es) (not all 4), then the "search" returns nothing at
all. What it should return is a selection from all 4 combo boxes
(i.e. if a user selects a database from cboDB, clicking the search
button should return the Database previously selected as well as the
Server and Policy it resides on, and the Application that runs the
Database.) Depending on the combo box data that is selected by the
user, clicking the search button will find the rest of the data that
is related to the data that was selected by the user previous to
clicking search.
Maybe I'm just having a Friday brain fart, but any help on getting
this working right is much appreciated!! Thanks in advance,
Dave- Hide quoted text -

- Show quoted text -
Jul 2 '07 #4
On Jul 2, 7:33 am, Dave <djwest...@gmail.comwrote:
Steve, thank you for your help! What you said to do works...however,
the expression for displaying all fields in the results doesn't fully
function.

If I choose 1 of the 4 combo boxes, it now works like a charm. It
brings up every specific instance that is tied to that one selected
combo box value. However, if I select, for example, an instance from
the Server and the Policy combo boxes, the results bring up ALL
instances of the server in ALL policies.

What it needs to do is if I choose two instances (one server in the
combo box and one policy that it resides on), it displays only that
one policy and only that one server (along with whatever databases and
applications are running on the selected server & policy).

So again, to reiterate/clarify, the problem is if I choose something
from both the Server and the Policy combo boxes and click search, it
brings up all Servers on the selected policy as well as all policies
that deal with the Selected server (many servers and many policies).
So instead I need it to give me the one server residing on the one
selected policy (along with DB and app info tied to the server
selected).

I don't think it is my normalization, but I guess it is possible.
Thanks again in advance...this forum is very helpful,

Dave

On Jun 29, 4:14 pm, "Steve" <s...@private.emailaddresswrote:
Assuming your form with the comboboxes is named FrmSearch, put the following
expression in the Server field of your query:
Forms!FrmSearch!cboServer Or (Forms!FrmSearch!cboServer Is Null)
Use a similar expression for the other three comboboxes.
PC Datasheet
Providing Customers A Resource For Help With Access, Excel And Word
Applications
resou...@pcdatasheet.com
"Dave" <djwest...@gmail.comwrote in message
news:11*********************@c77g2000hse.googlegro ups.com...
>I wasn't sure how to search for previous posts about this, it felt
real specific. Ok so here's the database & problem:
I have 4 combo boxes: cboServer, cboPolicy, cboDB, and
cboApplication. The idea behind the database is for a user to search/
select desired information in any kind of combination between the 4
combo boxes. Then the user clicks a button (btnSearch) and
subsequently a query ("Search Function") is run that shows all 4
different data selections from the 4 combo boxes.
Right now if a user selects something from EACH (all 4) combo box and
runs the search, it works fine (all 4 selections are displayed in
their respective columns).
Here's the issue: If the user selects information from only 3, 2, or
1 combo box(es) (not all 4), then the "search" returns nothing at
all. What it should return is a selection from all 4 combo boxes
(i.e. if a user selects a database from cboDB, clicking the search
button should return the Database previously selected as well as the
Server and Policy it resides on, and the Application that runs the
Database.) Depending on the combo box data that is selected by the
user, clicking the search button will find the rest of the data that
is related to the data that was selected by the user previous to
clicking search.
Maybe I'm just having a Friday brain fart, but any help on getting
this working right is much appreciated!! Thanks in advance,
Dave- Hide quoted text -
- Show quoted text -- Hide quoted text -

- Show quoted text -
Dave:

Roger Carlson has some excellent mdbs available for download on his
website that deals with exactly what you're looking for. Take a look
at the CreateQueries files for more guidance on how to build an
interface like what you're describing:
http://www.rogersaccesslibrary.com/T...ontents3.asp#C

HTH,
Jana

Jul 3 '07 #5

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

Similar topics

3
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
4
by: Heather | last post by:
Hi I am desparately looking for advice in relation to storing the results after selecting items from two combo boxes on a Referral form. The first combo box 'ctl Type' displays a full list of...
3
by: hmiller | last post by:
Hey everyone, I am having a hell of a time trying to set this menu system up. Here's what I'm trying to do. Combo Box One; is populated by names under properties "row source" "Phase 1"...
7
by: Arnold | last post by:
Greetings Gurus, In a mainform's header, I have a combobox named comboStudents. The rowsource for this combobox is: SELECT -999 As StudentID, "<Add New Student>" As FullName, "aaa" As...
2
by: kiranmn75 | last post by:
I want to dynamically populate a combo box through javascript. Data is coming from a array. Sometimes data list may contain items in excess of 2000. Explorer takes more than 5 seconds to...
1
by: Bruce HS | last post by:
I'm using VS2005, VB, WinForms I’ve developed forms using those nice wizards Microsoft provides. However, I’m running into a couple of complications trying to work with the resulting Table...
4
by: robtyketto | last post by:
I have generated combo boxes based on contents of other combos and am newbie who slowly learning vba code. Heres an example of vba code use to update one combo box from another ...
6
by: Dave | last post by:
I want to put the information that the user selects in my combo boxes into a subform that lies on the same form as the combo boxes. Thanks for your help already, Dave
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
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: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
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: 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...

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.