By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,836 Members | 2,004 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,836 IT Pros & Developers. It's quick & easy.

Combo Box complications

P: n/a
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
Share this Question
Share on Google+
4 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.