473,698 Members | 2,603 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cascading ComboBoxes

7 New Member
...You're fast! I appreciate that.

Thanks! I look forward to your explanation.

One last problem I have on my form is getting all of my comboboxes to update each other. I know how to update them as a cascade (i.e. Region updates Country which updates State which updates City) but I would like them to be interdependent (i.e. if I select a City, I want the Region, Country, and State comboboxes to populate with the corresponding data. Hoping to get this effect when I select any of these given boxes.

For ease of understanding, let's assume these are all of my comboboxes which correspond to a field of the same name, sans "com":
comRegion
comCountry
comState
comCity

Thanks again. You're a pro.
Nov 19 '09 #1
16 2389
NeoPa
32,569 Recognized Expert Moderator MVP
Tarheel,

Your earlier post just scraped by the thread-hijacking rule. This one blew it wide open. It is not your thread to change the subject in. That requires a new thread.

I've moved it for you. The thread this was split from is Checkbox form to allow user to select query output fields.
Nov 19 '09 #2
NeoPa
32,569 Recognized Expert Moderator MVP
As for your question, there are a couple of articles based around this subject. I think the better one for you would be Cascading Combo/List Boxes, but the other (Example Filtering on a Form) may also be worth a look.
Nov 19 '09 #3
OldBirdman
675 Contributor
This problem, as presented, has not been thought through.

Cascading ComboBoxes are a straight-forward concept. A user selects from the first (upper) box, and the selection in the next box is limited by this choice. Here, however, the user could select from a lower box first. So consider ...
1) If a city has already been selected, say USA->California->San Francisco, then Miami or New Orleans will not show, and will not be available for selection.
2) If a city is to be selected first, and there are more than one with that name, how is user to select. Google "Lakeview" or "Oakland" to realize this is not workable.

But there is a benefit to be able to choose California->San Francisco without selecting Americas->United States first. In my hobby of birding, I also have County after state, and Location after City, making the desire to shortcut the entire tree even more desirable.

I also have the problem that many geographic names in California start with "Santa ..." or "San ..." so typing in the combobox may not produce a unique result for many characters "Santa Clara" and "Santa Cruz" become unique on the 8th character.

Some suggestions that worked for me.
A) Have a 'Backfill' command button to fill in the cascade. This eliminates the problems in 1) above.
B) Have a 'Clear Down' command button at each level.
C) Limit the number of levels that can be skipped. I have found 3 is comfortable. Set Enabled=False for levels below this.
D1) Dynamically change the number of columns shown to display the missing levels.
D2) Sort by the lowest column level.

For example, user selects 'United States'. They skip the state, and display the list of cities. One level was skipped, so the City combobox will display 2 columns:
Expand|Select|Wrap|Line Numbers
  1. ......
  2. Lake View    | Iowa
  3. Lakeview     | Michigan
  4. Lakeview     | Oregon
  5. ......
  6. Oakland      | California
  7. Oakland      | Michigan
  8. Oakland      | New Jersey
  9. Oakland City | Indiana
  10. ......
Once the decisions about how this should perform are made, the code is very similar to the normal cascading comboboxes.
Nov 20 '09 #4
Tarheel
7 New Member
Hi OldBirdman,

Thanks so much for your comments and ideas. You make very good points about logical order and duplicate values. However, I was just using the Region, Country, State, City scenario as an example to make my point a bit clearer. In my database and on my form it is more of a common occurrence for the user to know the last value but not the preceding three (or any combination of each). This would be like the user not knowing the country or state, so they enter the city and the other boxes populate based on the city entry. This scenario is more likely in my actual case than this example.

Also, it may be necessary for the sake of querying to have interdependent boxes (pertaining to your Lakeview and Oakland problem: The user may want to know how many or which states have a city named Lakeview or Oakland).

I can write the logical statement for this in English, but cannot find the right combination of SQL and Event code.

If I cannot reach a solution to this, I will probably settle for one of your before-mentioned methods which to lend some great help.

I know all of this sounds convoluted and it is my fault for making you assume that example was my actual case.

Thanks again for your comments. They are very valid, but the main goal of this form is to make it as intuitive and user friendly as possible. Any follow-up or breakthroughs are very welcome.
Nov 20 '09 #5
OldBirdman
675 Contributor
You seem to be writing code (SQL statements and event procedures) before you have a design to work from. As a believer in planning before writing code, I'm glad you found my comments useful. I too like extreme 'User Friendly' interfaces. But your coding seems premature.
Perhaps if you gave the actual problem, comments could be more specific to your needs. I think you are attempting to choose from a list of items that are better recognized than remembered. Perhaps there are duplicates, or near duplicates. Perhaps the items are in a natural language and, like city names, tend to look similar, sound similar, and be unevenly distributed within the alphabet.
In your comboboxes, are you selecting to a single record, or can the final choice be multiple records? How will these be displayed? What is to be done with them once displayed? Such questions may be necessary to find a 'user friendly' design.
Nov 20 '09 #6
topher23
234 Recognized Expert New Member
Tarheel,

If you're going to provide an example, the example needs to be what you're actually working on and not completely contrived. You said

let's assume these are all of my comboboxes which correspond to a field of the same name, sans "com":
comRegion
comCountry
comState
comCity
which, obviously, leads anyone looking over this post to help out to assume those are your actual fields and combo boxes. If they are not, then we can assume you don't want an answer to your actual problem, otherwise you'd post it.

P.S. I don't mean to be an arse here, but it always bothers me when someone doesn't ask the question they actually want answered, whether it be on the internet or in real life. One of my pet peeves I suppose.
Nov 20 '09 #7
ajalwaysus
266 Recognized Expert Contributor
@topher23
Also, no offense Tarheel, since I do not know your level of expertise in Access, but it helps to post the actual full information because:
1. You may not have a full understanding of what is relevant and what isn't, yet, which doesn't mean you won't get there. We are here to help you get there. =)
2. You should never skim on information, because you never know when someone may have an "AHA!" moment that will by far help you the most. I have seen it many time on this site.

-AJ
Nov 20 '09 #8
Tarheel
7 New Member
A sincere thank you for all of your comments and no offense taken. I see what you mean. I did however feel that my examples were a relevant scenario and posed a simple explanation of my intended goal. I feel like people focused too much on the "why" aspect of my question instead of the "how." I do see where you're coming from with the "AHA!" moment and it is my mistake for not providing my actual scenario but please take my word for it when I say that my DB and fields cover a topic that is not widely known or understood. I did pose the example scenario because I felt this problem was one widely experienced, and once the answer was provided it was going to be an easy fix that I simply didn't think of. I have decided to go a different route with my user interface as a whole. It is great to see that you are all very knowledgeable and so willing to help complete strangers. Thank you all for your time and have a nice day.
Nov 20 '09 #9
topher23
234 Recognized Expert New Member
Trust me when I say that it doesn't matter what you're building the database for, there is always someone other than you who knows what you're talking about. If not, many of us are willing to research the field in order to better understand the issue.
Nov 20 '09 #10

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

Similar topics

1
2013
by: JMosey | last post by:
Not sure if this has been covered ( a google search came up pretty bare). I have a site that: - has multi-level cascading menus - floats center of the browser window - Will have fairly heavy Safari and Firefox views (~25%) Finding a cascading menu is easy, I trip over about half a dozen of those a week. The problem is when you maximize on a big screen in
4
1968
by: Kathy | last post by:
In my custom menu one menu item opens a form to add new Makes to TblMakes and another menu item opens a form to add new Models to TblModels. I have a form that has a combobox for Makes and a combobox for Models. In both comboboxes I use the NotInList event and code to allow users to enter Makes and Models that are not in the database. When the form is open, I want to limit the users to entering new Makes and Models in the comboboxes and not...
0
2075
by: cognoscento | last post by:
I'm currently putting together a database for my work (not an expert by any stretch, so muddling through as best as I can... you know the story...) and I could use some advice and hand-holding I've got a subform with a series of cascading combo boxes (thanks to the Access tutorials on fontstuff.com) that let the user assign categories to items, in this case photos. This is being done to help constrain user selections and keep the...
4
7820
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 this results in the BindingContext's Current.Row.Rowstate becoming 'Modified' whenever the BindingContext position changes. What is the RIGHT way to go about this? Thanks, -- Pat
6
2084
by: visionstate | last post by:
Hi there, I am building a database that requires cascading lists on a form. I currently have (I may be adding more later) 3 combo boxes on my form - Department, Surname and Forename. The user chooses the department they want and then the corresponding surnames from that department can be chosen from the Surname box and then the Forename depending on which Surname they chose. I then have a command button which produces the results of the...
19
2319
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 (surely due to my incompetence). I've printed out Rabbit's tutorial and read it many times, but like others, I feel I need a more elementary approach. Please let me explain: I'm creating a database for entering information for research studies. ...
4
3489
klarae99
by: klarae99 | last post by:
Hello, I am working on an Access 2003 Database. The tables that pertain to this issue are tblOrg, tblState, tblCity, and tblZip. I have posted the table structure with only the pertinant fields below. tblOrg OrgID, AutoNumber, PK ZipID, Number, FK tblState StateID, AutoNumber, PK
12
1713
by: azalea45 | last post by:
Hi all I am a newbie when it comes to access. My company requires that all Databases run on the company SQL back-end as a result i have a Access project that connects to the server. I have two tables, table 1 called tblProjectDetails, table 2 called tblLearners The fields in tblProjectDetails are ProjectPK numeric (Its also the Primary Key)] Name char (50) Description char (50) There are other field but they dont play a role in the...
16
10596
by: AFSSkier | last post by:
I have several cascading ComboBoxes & would like to close Cbo2 & open Cbo1 when there is an error. These CboBoxes are on an Excel spreadsheet, not a UserForm. I have the following code, if the Dropdown is opened it requeries Cbo2 to ListIndex = 0. But I also want it to close (unselect, undrop list) Cbo2 & open (select, dropdown) Cbo1 on MsgBox error. This insures the user selects property of Cbo1 first. Private Sub...
0
8680
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8609
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9169
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8899
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8871
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6528
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5861
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4371
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2335
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.