ComboBoxA shows filtered results by what was chosen in ComboBoxB

G

Guest

ACCESS 2007
ComboBoxA shows filtered results by what was chosen in ComboBoxB

Hello, My name is Matt. Could a vba/macro/access guru help me?
By the way, I LOVE OFFICE 07!!!!

I am trying to achieve the fallowing and have been up and down this forum
and the internet without finding a clear concise answer! Please help!

A form where I have 2 ComboBoxs.
When I select the first ComboBox the second ComboBox UPDATES to filter out
the rest..

ComboBoxA lists for instance HARDWARE, SOFTWARE, SERVICES
ComboBoxB lists related to A CABLES, FREEWARE, ONSITE SERVICE

When I select item from ComboBoxA
ComboBoxB's results SHOWS CABLES and filters out FREEWARE, ONSITE SERVICE

Here is a sample of the content of the table = CATEGORIES

hardwareID category subCategory type subType
----------------------------------------------------------------------------
1 HARDWARE CABLES USB 2.0
1 HARDWARE CABLES USB 1.0

----------------------------------------------
I HAVE 2 TABLES
----------------------------------------------
PRODUCTS | CATEGORIES
============================
hardwareID | hardwareTypeID
category | category
subCategory | subCategory
type | type
subType | subType

----------------------------------------------
ONE FORM
----------------------------------------------
HARDWARE

---------------------------------------------
2 ComboBoxs ON FORM = HARDWARE
---------------------------------------------
category
subcategory


This is what I have tried in ROW source
SELECT subCategory FROM CATEGORIES WHERE
subCategory=Forms!THARDWARE!category;

----------

HELP! Thank you
Matt Valencia

Tags: access 2007 combobox updates after choice, combobox update filter
 
G

Guest

WHOOPS! that should have been titled

ComboBoxB shows filtered results by what was chosen in ComboBoxA
 
G

Guest

Hello Everyone!

I have a question regarding "cascading combobox(s) list(s)"

I would like:

ComboBox 2 to show results from ComboBox 1's selection,
then ComboBox 4 to show results from ComboBox 3's choice

For Instance these are the combo boxes
[category] [subcategory] [type] [subtype]

This is the sample of choices in the combo boxes
HARDWARE - CABLES - USB - 2.0
HARDWARE - CPU - AMD - AM2

QUESTION

Do I create ONE table for this?
Do I create 4 tables?

Should I create the TABLE then QUERY Then FORM THEN VBA?
Should I create the TABLE(s) then QUERY then FORM then SQL in CONTROL?

What is the best solution? so many answers, but from what i gather NEVER use
a lookup in a table field.

thank you *.*!!!

Matt
 
C

Carl Rapson

mattyv said:
Hello Everyone!

I have a question regarding "cascading combobox(s) list(s)"

I would like:

ComboBox 2 to show results from ComboBox 1's selection,
then ComboBox 4 to show results from ComboBox 3's choice

For Instance these are the combo boxes
[category] [subcategory] [type] [subtype]

This is the sample of choices in the combo boxes
HARDWARE - CABLES - USB - 2.0
HARDWARE - CPU - AMD - AM2

QUESTION

Do I create ONE table for this?
Do I create 4 tables?

Should I create the TABLE then QUERY Then FORM THEN VBA?
Should I create the TABLE(s) then QUERY then FORM then SQL in CONTROL?

What is the best solution? so many answers, but from what i gather NEVER
use
a lookup in a table field.

thank you *.*!!!

Matt

If the sequence of selection is "Category -> Subcategory -> Type ->
Subtype", then you'll need 4 tables: Categories, Subcategories (with a FK
link to the Categories PK), Types (with a FK link to the Subcategories PK),
and Subtypes (with a FK link to the Types PK). You'll want to put VBA code
in each combo box's AfterUpdate event to redefine the next combo box's
RowSource property to reflect the selection.

Carl Rapson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top