Cascading combo, 7 Catagories and 19 Subcatagories

D

desireemm

Hi guys I have a question about combo boxes. We have a two combo boxes one is
the [Catagory for hours] so when you look at the drop down it says
"LifeSkills";"Education";"Culture";"Travel";"J ob Skills
Training";"Parenting";"ITP";"Phone Calls";

the next combo box has the subcatagories for the[Catagory for hours] its
called [Services covered] and when you open the drop down here is what you
see "Academic Assessment";"MER Completion- TANF";"Career Training
Plan";"Counseling";"Phone Call";"EHS Training/Home Visits";"Training/Office
Visits";"Indpendent Study";"Indpendent Job Skills Training";"Career Training
Workshop";"Resume Writing";"SCAIR Soaring Eagles";"Regalia";"Pow Wow
Participation";"GED/High School Diploma Preparation";"Adult Basics
Education";"Computer Skills";"Indpendent Study";"Drivers Education";

What I would like to happen is that when the user chooses ITP from the
[Catagory for Hours] the only thing that shows up in the [Services Covered]
combo box is "Academic Assessment";"MER Completion- TANF";"Career Training
Plan";"Counseling";"Phone Call";
and when they choose Parenting the only thing that will show in the [Services
Covered] is EHS Training/Home Visits";"Training/Office Visits";"Indpendent
Study";

So basically when the User chooses a Catagory the only thing that shows up in
the subcatagory combo box [Services Covered] is the subcatagories pertaining
to that Catagory. is this possible??

the reason why I have to do it this way is becuase there is a report that is
based off these two combo boxes and the colum headings of the report are the
based offf the [catagory for hours] the headings are Parenting, ITP, Job
Skills training, Education and travel. so the combo boxes have to be
seperated. Does that make sense??


Example
Catagory

ITP

SubCatagory

Academic Assesment
MER Completion-TANF
Career Training Plan
Counseling
Phone Call





Parenting

EHS Training/ Home Visit
Training/Office Visit
Independent Study


Job Skills Training

Independent Job Skills Training
Career Training Workshop
Resume Writing
 
D

Douglas J. Steele

It's not clear to me where the various values are coming from, so I can only
offer a generic solution, but what you need to do is put code in the
AfterUpdate event of the first combo box to change the values of the second
combo box.

For example, if the values in the second combo box come from a table, you'd
do something like:

Private Sub Combo1_AfterUpdate()

Dim strSQL As String

strSQL = "SELECT Field1, Field2 " & _
"FROM MyTable " & _
"WHERE FK = " & Me!Combo1
Me!Combo2.RowSource = strSQL

End Sub
 
D

desireemm via AccessMonster.com

Hello Douglas thank your reply. Its not based on a Table, its just in the
rowsource of the TanfActivity_tbl. The Rowsource type is Value List. There
are two combo boxes one is called [Catagory for hours] (which is the Main
Catagory) the other is called [Services Covered], I need to makie it so that
the Services covered is based off of the [Catagory for hours] in other words
if the user chooses ITP from the Catagory for hours the only thing that shows
up in the [ Services covered] is Academic Assesment
MER Completion-TANF
Career Training Plan
Counseling
Phone Call

So the Services covered is based off of what the user chooses in the
[Catagory for hours]
Not sure how to do that since I have 7 Catagories [Catagory for hours] and 19
SubCatagories [Services Covered]

thank you for your help
It's not clear to me where the various values are coming from, so I can only
offer a generic solution, but what you need to do is put code in the
AfterUpdate event of the first combo box to change the values of the second
combo box.

For example, if the values in the second combo box come from a table, you'd
do something like:

Private Sub Combo1_AfterUpdate()

Dim strSQL As String

strSQL = "SELECT Field1, Field2 " & _
"FROM MyTable " & _
"WHERE FK = " & Me!Combo1
Me!Combo2.RowSource = strSQL

End Sub
Hi guys I have a question about combo boxes. We have a two combo boxes one
is
[quoted text clipped - 61 lines]
Career Training Workshop
Resume Writing
 
D

Douglas J. Steele

In that case, you'll need to hard-code the values in the AfterUpdate event.

Private Sub Combo1_AfterUpdate()

Select Case Me!Combo1
Case "Value 1"
Me!Combo2.RowSource = "Selection 1;Selection 2"
Case "Value 2"
Me!Combo2.RowSource = "Selection 2;Selection 3;Selection 4"
Case "Value 3"
Me!Combo2.RowSource = "Selection 1;Selection 2;Selection 3;Selection
4"
End Select

End Sub


--
Doug Steele, Microsoft Access MVP

(no private e-mails, please)


desireemm via AccessMonster.com said:
Hello Douglas thank your reply. Its not based on a Table, its just in the
rowsource of the TanfActivity_tbl. The Rowsource type is Value List.
There
are two combo boxes one is called [Catagory for hours] (which is the Main
Catagory) the other is called [Services Covered], I need to makie it so
that
the Services covered is based off of the [Catagory for hours] in other
words
if the user chooses ITP from the Catagory for hours the only thing that
shows
up in the [ Services covered] is Academic Assesment
MER Completion-TANF
Career Training Plan
Counseling
Phone Call

So the Services covered is based off of what the user chooses in the
[Catagory for hours]
Not sure how to do that since I have 7 Catagories [Catagory for hours] and
19
SubCatagories [Services Covered]

thank you for your help
It's not clear to me where the various values are coming from, so I can
only
offer a generic solution, but what you need to do is put code in the
AfterUpdate event of the first combo box to change the values of the
second
combo box.

For example, if the values in the second combo box come from a table,
you'd
do something like:

Private Sub Combo1_AfterUpdate()

Dim strSQL As String

strSQL = "SELECT Field1, Field2 " & _
"FROM MyTable " & _
"WHERE FK = " & Me!Combo1
Me!Combo2.RowSource = strSQL

End Sub
Hi guys I have a question about combo boxes. We have a two combo boxes
one
is
[quoted text clipped - 61 lines]
Career Training Workshop
Resume Writing
 

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