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

How do I connect two combo boxes in a form?

P: n/a
Scenario:

Department A has divisions 1,2,3
Department B has divisions 4,5,6

I want my form to work such that if I choose Department A from a
"Department" combo box, that only 1, 2, and 3 show up in the
"Division" combo box and if I choose B then only 4, 5, and 6 are
available.

I have a Dept. table, a Dept_A_Divisions Table and a Dept_B_Divisions
table. The combo boxes (along with other fields) will provide input to
the main table.

I've searched through help files and tried a variety of things
(different queries, expressions, functions), but I think I'm missing
some small piece (screwing up syntax possibly). Hopefully I'm making
it harder than it really is and there is some simple solution to my
problem. Any help would be greatly appreciated.

TIA

Rick
Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Rick,

You need to first revise your tables to:
TblDept
DeptID
Dept

TblDiv
DivID
DeptID
Div

Base the first combobox on TblDept. Bound Column = 1, Column Count = 2,
Column Widths = 0;1. Name it DeptID.
Base the second combobox on a query based on TblDiv. Include the fields
DivID, Div, DeptID in that order. In DeptID field, put the following
expression in the criteria:
Forms!MyForm!DeptID
Base the second combobox on the query. Bound Column = 1, Column Count = 2,
Column Widths = 0;1. Name it DivID.
Put the following code in the AfterUpdate event of the first combobox:
Me!DiVid.Requery

--
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdatasheet.com
www.pcdatasheet.com
<cr***@hidden.net> wrote in message
news:ca********************************@4ax.com...
Scenario:

Department A has divisions 1,2,3
Department B has divisions 4,5,6

I want my form to work such that if I choose Department A from a
"Department" combo box, that only 1, 2, and 3 show up in the
"Division" combo box and if I choose B then only 4, 5, and 6 are
available.

I have a Dept. table, a Dept_A_Divisions Table and a Dept_B_Divisions
table. The combo boxes (along with other fields) will provide input to
the main table.

I've searched through help files and tried a variety of things
(different queries, expressions, functions), but I think I'm missing
some small piece (screwing up syntax possibly). Hopefully I'm making
it harder than it really is and there is some simple solution to my
problem. Any help would be greatly appreciated.

TIA

Rick

Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.