Full Version: Cascading Combos with subform problem
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
lenmor
Hello to all !
I have this db where i wantto include 4 and if possible 5 cascading combos where the user can select records from a table and view them in a subform which is in datasheet view.
All is going well until i try to add the 4th combo.Then when i select the 4th combos selection the subform displays nothing.
If someone could point me to the right direction i would be most thankful.
I have attached the db.
Thx for all replies
KenSnell
I haven't downloaded your database yet. Let's chat a bit first about what you're trying to do here. (My experience has been that talking about the question can be more useful initially than just looking at a database about which I know almost nothing.)

It sounds as if you're wanting to use combo boxes (cascading) as a filtering process for the data to be displayed in the subform. Is this correct?

If yes, is it possible that the subform displays no data simply because no records meet the "criteria" established by the combo boxes?

If no, what is the purpose of the combo boxes?

Tell us what you're wanting to do -- in words that describe the data and actions. It may be that a different approach will be better, depending upon what you're wanting to do.
lenmor
Yes Ken that is correct.I am ryig to have the combo's filter the data fo the user and show him the data that fit those parameters in the subform.

The thing is that everythingworks fine up to the 3rd combo i have added to the form and all data are diaplyed without problems , but when i add a 4th combo even though the combo gets it's rowsource correctly in the after update event where the main filtering takes place the suborm will not display any records (and i know that there are!!!).

Futhermore I want to use this little thingy on the form to recreate an application that my company has which basically implements all this filterng combo business along with some buttons that come from that field (mapkeys_txt) that let the user select the car he wants and then give him using some buttons what components of the car of his choice he can interact with.

Well that's about it plz download the db it's small and will give a better idea of what I am taling about. frown.gif
lenmor
Nothing yet anyone?
KenSnell
I'm tied up with work stuff at the moment... I'll take a look at the new information later today.
KenSnell
OK - I've poked around in your database a bit.

First thing I note is that there is no Row Source for "cboYear" combo box. So the filtering code that you're running on its AfterUpdate event wouldn't have a value to use, and thus the query will not return anything except if the "TMAP_OBD.vperiod_txt" field has an empty string (note that a Null will not be found by your code's query construction). In looking at the "TMAP_OBD.vperiod_txt" data, I see that every record has some type of string in this field, so the query will always return no records based on your current setup.

However, the setup that you're using is very limited. If your user decides to select the combo boxes out of order or decides to go back and change the setting of one of the "earlier" combo boxes, the code will ignore the values in the "later" combo boxes. I doubt that this is what you want.

I have a sample database that shows a reasonably easy way to create a "WHERE" string's contents based on whether values have been selected in a control or not. See http://www.cadellsoftware.org/SampleDBs.htm#FilterForm for this sample database. It allows an unlimited number of controls/selections, and is based on "excluding" from the WHERE string any field where its "corresonding" control has been left empty.

I think this will be a better way for what you want to do.
lenmor
OK got it thx for your time i will give it a look and get back to you frown.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.