473,399 Members | 3,106 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,399 software developers and data experts.

Cascading(?) Combo-box Filters, Selection reduction problem.

34
I have a record lookup form that has several combo box filters set up. However I noticed a slight problem. The filters are working correctly, but there are now over 2000 entries and when filtering there are too many possible selection even with other filters applied.

Example 1:
POC Doe, John wants to look up a record he created on 01/01/2010. He selects his name and after updating he accidentally selects 01/02/2010 (despite that fact that none of the records he created have this date) filtering out all possible results.

Example 2: Doe, John created 50 separate records on 01/01/2010 and after filtering down to his name and the Date he still has to go looking for the record. There are 3 other filtering options but he can't remember the needed information off the top of his head and there are well over 300 possible selections.

Even after the first filter is applied there are still several hundred options in several of the other combo boxes that the user must go through to find the appropriate data.

Solution: Reducing the number of options available on the other combo boxes to only available records each time after a filter is applied.

Below is my current code being used:

Expand|Select|Wrap|Line Numbers
  1. Private Sub CAR_AfterUpdate()
  2.     SetFilter
  3. End Sub
  4. Private Sub Date_AfterUpdate()
  5.     SetFilter
  6. End Sub
  7. Private Sub System_AfterUpdate()
  8.     SetFilter
  9. End Sub
  10. Private Sub MAJCOM_AfterUpdate()
  11.     SetFilter
  12. End Sub
  13. Private Sub System_POC_AfterUpdate()
  14.     SetFilter
  15. End Sub
  16. Private Sub SetFilter()
  17.     Dim FilterCriteria As String
  18.     If CAR & "" <> "" Then FilterCriteria = FilterCriteria & " AND [CAR]='" & CAR & "'"
  19.     If Date & "" <> "" Then FilterCriteria = FilterCriteria & " AND [Date]='" & Date & "'"
  20.     If System & "" <> "" Then FilterCriteria = FilterCriteria & " AND [System]='" & System & "'"
  21.     If MAJCOM & "" <> "" Then FilterCriteria = FilterCriteria & " AND [MAJCOM]='" & MAJCOM & "'"
  22.     If System_POC & "" <> "" Then FilterCriteria = FilterCriteria & " AND [System POC]='" & System_POC & "'"
  23.     If FilterCriteria = "" Then
  24.             Me.FilterOn = False
  25.     Else
  26.         FilterCriteria = Mid(FilterCriteria, 6) 'REMOVE THE LEADING " AND "
  27.         Me.Filter = FilterCriteria
  28.         Me.FilterOn = True
  29.     End If
  30. End Sub
What would I need to do to make it to where each combo box limits the selectable options to only that data which has passed any of the filters shows in the remaining unused filter boxes.

Example:
With none of the filters selected there are 2100+ available records. I select Doe, John in the Car section and it filters down to 114 records. However all 2100+ records are still available in the System combo box as selectable options despite only 114 (or less) being viable options. I select a system I know his name is associated with and it limits it to 11 records, however 2100+ MAJCOM records are still selectable as filtering options when only 5 are viable.

I guess this is a cascading combo box filtering, but I can't seem to figure out how to do it. I looked through a lot of the forums and though there are some very good tutorials on building cascading combo boxes from multiple tables and from scratch, there doesn't seem to be anything posted on integrating a cascading effect into already established code, and I'm too afraid of breaking the code to experiment. Any help would be appreciated. Thanks.

BTW... I'm a coding "dummy"
Sep 24 '10 #1
3 2593
slenish
283 100+
Hello MOCaseA,

I have had some experience with this myself. Check out this link and see if it does not help answer your questions.

enjoy :D

http://www.databasedev.co.uk/filter_combo_boxes.html
Sep 25 '10 #2
MOCaseA
34
It looks like it might help... I'll have to tweak it and see what happens... Wish me luck.
Sep 25 '10 #3
slenish
283 100+
Good Luck :D
Sep 25 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: John Ryan | last post by:
I've a small bit of javascript on my site that has a from with 2 selection boxes, when you choose an option in the first box, the second one re-populates its list accordingly. But the second...
2
by: Job Lot | last post by:
I have 2 group box Buy and Sell on a form. There is an account combo box in both group boxes bound to same data source using DataSource, DisplayMember and ValueMember. Problem is binding context is...
4
by: pmcguire | last post by:
I have 2 bound ComboBoxes. I want the datasource of the second to be limited by the selection made in the first. I can do this by responding to the SelectionIndexChanged event on the first, but...
5
by: Eric A. Johnson | last post by:
Hi Everyone, I am at my wit's end here. I have a combobox (combyQueryTitle) that I need to use in order to select a query for my database project. Therefore, I am using the...
1
by: Drakemar | last post by:
What I thought was a real simple thing to do has out not to be. I have a real simple Access database with two tables: Student Table id (autonumber) *primary key* name (text) teacherID (int)...
1
by: =?Utf-8?B?RWl0YW4=?= | last post by:
Hello, I have a ComboBox named comboBoxSelChannel. I declared a structure named MySturct. public struct MyStruct { public int Index; public string Name;
1
by: ray well | last post by:
i'm loading a combobox from a database in code, by setting the the DataSouce to a table, and the DisplayMember to a field. it loads the first row into the text area of the combobox automatically....
19
by: Amanduh | last post by:
Hi again, brilliant developers. I'm having serious issues with cascading comboboxes. I had it working perfectly before, but then was asked to add an additional variable and everything went haywire...
1
by: Aicho | last post by:
Hi, We've recently noticed a very strange occurrence with one of our comboboxes. In that instance, it concerned a databound combobox bound to a collection of items of which some had the same...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.