Cascading Combo Boxes

hnguyen

New member
Local time
Today, 08:33
Joined
Jun 30, 2011
Messages
2
I'm completely new to Access and am having an impossible time trying to get my cascading combo box to work. I want to have my "Sub Issues" combo box values to be based on my "Main Issues" combo box.

It seems about as straight forward as it can be, but I've tried so many different codes and it's just not working! I've attached my file so hopefully someone can tell me what I'm doing wrong and I can learn how to do it right.

Thanks in advance!!
 

Attachments

Just a word of advice, if the fields are linked in the database, a very simple and easy solution is to use a subform with master/child fields designated in the form properties. Access will then do all the coding for you :D

http://fisher.osu.edu/~muhanna_1/837/MSAccess/tutorials/subforms.pdf

Making the combo box do this is a more complicated job, because you need to add a search criteria to the query behind the combo box. This usually requires fairly extensive knowledge of form and query properties, as well as some VBA knowledge

as for your coding line

Code:
"WHERE tbl[Main Sub Link].[Main Issues] = '" & cbo[Main Issues].Value

is off the mark, because with multiple values, even if the syntax was right you give you
tbl[Main Sub Link].[Main Issues] = '" & cbo[Main Issues].Value1cbo[Main Issues].Value2cbo[Main Issues].Value3...
or something to this regard. It should look more like:

tbl[Main Sub Link].[Main Issues] = '" & cbo[Main Issues].Value1 & "OR" & cbo[Main Issues].Value2 & "OR" & cbo[Main Issues].Value3...

You may also want to Give a more detailed description of exactly what you are trying to accomplish. I know from experience this works wonders. Happy Coding :D
 
thanks! i had come across mention of parent child relationships, but i was getting so many different options--querying, filters, and then the cascading combo box thing. it's been like chasing a rabbit all over the map.

basically what i'm trying to set up is a database to catalogue regulatory releases so that they're searchable by the topic of the release. so i created a table for the "main issues" and then a table for the "sub issues" then a table "main sub link" that indexed all the sub issues connected to a particular main issue. THEN, i made another table that actually had the regulatory releases--release number, date, people involved, a brief description of the release, and a main issues and a sub issues column.

from there, i created a form that would allow users to "add a record" (populating the fields in the release enforcement table); another form to "search a record" (i haven't even attempted the coding on this yet, but ideally be able to search by various fields like release number, dates, people involved, and most importantly the issues). now, i've got the add record form to properly populate the release table, BUT i can't get it to synchronize the boxes so that when a person comes in and chooses a couple main issues, they'll be able to choose the sub issues indexed to those main ones.

i'm readin gup on your tutuorial you sent me and i'll keep you posted. any other advice you have will be much appreciated--thanks!!
 

Users who are viewing this thread

Back
Top Bottom