473,324 Members | 2,257 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,324 software developers and data experts.

How do I connect two combo boxes in a form?

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
1 7707
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: FZ | last post by:
Hi Gang, I was wondering if a generous person might be able to walk me through what I believe is a pretty simple task. I actually have significant Access experience, but I haven't done it in...
0
by: Krisa | last post by:
Hello all, I just discovered something (stop me if you've heard this before....) that was causing me a significant performance hit when opening a form with subforms. To speed up loading the...
1
by: Robert Neville | last post by:
The solution to my dilemma seems straight-forward, yet my mind has not been forthcoming with a direct route. My Project form has a tab control with multiple sub-forms; these distinct sub-forms...
2
by: Sean | last post by:
Greetings all, I am attempting to make a form that will filter through several tables that (I believe) have refretial integrity. I am pulling data from several tables into the form and i would...
5
by: jjyconsulting | last post by:
Newbie needing some help. I have a tblParticipants. The fields include gender, education_level, income, occupation etc., I'm trying to create a form where a user can run a query from the form and...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
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
1
by: Dave | last post by:
Hello all, First I'd like to apologize...This post was meant to be put in my previous post, but I tried many times without success to reply within my previous post. Now here goes... I have a...
2
by: Dave | last post by:
I have 3 tables of information feeding into 4 combo boxes on my main form (DR Form). I have as many list boxes (acting as text boxes) as there are fields in each one of the 3 tables. Once...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.