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

Search based on two combo boxes

P: n/a
I have a form (View All Assets) with two combo boxes (ComboManufacturer
& ComboProductType) and a subform with a dataview that displays the
results of my query below:

SELECT Assets.[RDC Asset Number], Assets.
Description, Assets.[Serial Number], Assets.[Misc Description],
Assets.Mfg, Assets.[Model/Part Number], Assets.[Misc Description]
FROM Assets
WHERE (((Assets.Description)=Forms![View All Assets].ComboProductType)
And ((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));

What I want to be able to do is choose a manufacturer from the one
combobox (e.g. IBM) and select a Product type from the other combo box
(e.g. Server) and get the results of an "aggregate" query for lack of a
better word.

My query above is not working, but I can get use:

WHERE (((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));

and this gives me ALL the assets for "IBM". So I just need help I guess
with how to use both comboboxes together and as I change the value I
get a refreshed result in my subform dataview.
Thanks! Bhavesh

Sep 27 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a

<pa*************@yahoo.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
I have a form (View All Assets) with two combo boxes (ComboManufacturer
& ComboProductType) and a subform with a dataview that displays the
results of my query below:

SELECT Assets.[RDC Asset Number], Assets.
Description, Assets.[Serial Number], Assets.[Misc Description],
Assets.Mfg, Assets.[Model/Part Number], Assets.[Misc Description]
FROM Assets
WHERE (((Assets.Description)=Forms![View All Assets].ComboProductType)
And ((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));

What I want to be able to do is choose a manufacturer from the one
combobox (e.g. IBM) and select a Product type from the other combo box
(e.g. Server) and get the results of an "aggregate" query for lack of a
better word.

My query above is not working, but I can get use:

WHERE (((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));

and this gives me ALL the assets for "IBM". So I just need help I guess
with how to use both comboboxes together and as I change the value I
get a refreshed result in my subform dataview.
Thanks! Bhavesh
Can't think why you're selecting the field Assets.[Misc Description] twice
in you query ?
This works fine for me in Access 97 :
SELECT Assets.[RDC Asset Number],
Assets.Description, Assets.[Serial Number],
Assets.[Misc Description], Assets.Mfg,
Assets.[Model/Part Number]
FROM Assets
WHERE Assets.Description =
Forms![View All Assets].ComboProductType
And
Assets.Mfg = Forms![View All Assets].ComboManufacturer;
With the following event procedures:

Private Sub ComboManufacturer_Change()
subform.Requery
End Sub

Private Sub ComboProductType_Change()
subform.Requery
End Sub
Please let me know how you get on...
woodglass...
Sep 27 '06 #2

P: n/a
Thanks! I have that it works now. I want to do one more thing... in my
second combobox I want to instead of choosing an available value, I
want to show ALL the records based on the value in the first combobox
with the second being ignored. Example: as I have set up now I choose
from a list of Manufacturers, say IBM, then choose a product type, say
SERVER... this gives me all the IBM-SERVERS.... but I also want to
choose IBM and show ALL product types.... any ideas?

aTdHvAaNnKcSe !
Bhavesh

woodglass wrote:
<pa*************@yahoo.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
I have a form (View All Assets) with two combo boxes (ComboManufacturer
& ComboProductType) and a subform with a dataview that displays the
results of my query below:

SELECT Assets.[RDC Asset Number], Assets.
Description, Assets.[Serial Number],
Assets.Mfg, Assets.[Model/Part Number], Assets.[Misc Description]
FROM Assets
WHERE (((Assets.Description)=Forms![View All Assets].ComboProductType)
And ((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));

What I want to be able to do is choose a manufacturer from the one
combobox (e.g. IBM) and select a Product type from the other combo box
(e.g. Server) and get the results of an "aggregate" query for lack of a
better word.

My query above is not working, but I can get use:

WHERE (((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));

and this gives me ALL the assets for "IBM". So I just need help I guess
with how to use both comboboxes together and as I change the value I
get a refreshed result in my subform dataview.
Thanks! Bhavesh


This works fine for me in Access 97 :
SELECT Assets.[RDC Asset Number],
Assets.Description, Assets.[Serial Number],
Assets.[Misc Description], Assets.Mfg,
Assets.[Model/Part Number]
FROM Assets
WHERE Assets.Description =
Forms![View All Assets].ComboProductType
And
Assets.Mfg = Forms![View All Assets].ComboManufacturer;
With the following event procedures:

Private Sub ComboManufacturer_Change()
subform.Requery
End Sub

Private Sub ComboProductType_Change()
subform.Requery
End Sub
Please let me know how you get on...
woodglass...
Oct 4 '06 #3

P: n/a
Sorry be a pest, this one is driving me like a banana. Thanks!!! Please
reference:
____________________________________________
pa*************@yahoo.com wrote:
Thanks! I have that it works now. I want to do one more thing... in my
second combobox I want to instead of choosing an available value, I
want to show ALL the records based on the value in the first combobox
with the second being ignored. Example: as I have set up now I choose
from a list of Manufacturers, say IBM, then choose a product type, say
SERVER... this gives me all the IBM-SERVERS.... but I also want to
choose IBM and show ALL product types.... any ideas?

aTdHvAaNnKcSe !
Bhavesh
__________________________________________________ ____________
woodglass wrote:
<pa*************@yahoo.comwrote in message
news:11*********************@m73g2000cwd.googlegro ups.com...
I have a form (View All Assets) with two combo boxes (ComboManufacturer
& ComboProductType) and a subform with a dataview that displays the
results of my query below:
>
SELECT Assets.[RDC Asset Number], Assets.
Description, Assets.[Serial Number],
Assets.Mfg, Assets.[Model/Part Number], Assets.[Misc Description]
FROM Assets
WHERE (((Assets.Description)=Forms![View All Assets].ComboProductType)
And ((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));
>
What I want to be able to do is choose a manufacturer from the one
combobox (e.g. IBM) and select a Product type from the other combo box
(e.g. Server) and get the results of an "aggregate" query for lack of a
better word.
>
My query above is not working, but I can get use:
>
WHERE (((Assets.Mfg)=Forms![View All Assets].ComboManufacturer));
>
and this gives me ALL the assets for "IBM". So I just need help I guess
with how to use both comboboxes together and as I change the value I
get a refreshed result in my subform dataview.
>
>
Thanks! Bhavesh
>

This works fine for me in Access 97 :
SELECT Assets.[RDC Asset Number],
Assets.Description, Assets.[Serial Number],
Assets.[Misc Description], Assets.Mfg,
Assets.[Model/Part Number]
FROM Assets
WHERE Assets.Description =
Forms![View All Assets].ComboProductType
And
Assets.Mfg = Forms![View All Assets].ComboManufacturer;
With the following event procedures:

Private Sub ComboManufacturer_Change()
subform.Requery
End Sub

Private Sub ComboProductType_Change()
subform.Requery
End Sub
Please let me know how you get on...
woodglass...
Oct 6 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.