Solved

Not In the list cascading combox

Posted on 2014-04-22
6
206 Views
Last Modified: 2014-04-28
Access 2010, How to update cascading combo boxes:  cboShopCountry,  cboShopState, cboShopCity with new values.
Can it be done through Not In the list event?
Do you have example?
0
Comment
Question by:Taras
  • 3
  • 2
6 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40016117
what exactly do you mean by update combo boxes?

the on not in list event is use to add items to combo boxes lists.
see this link
http://support.microsoft.com/kb/197526

post back if this is not what you want/need
0
 

Author Comment

by:Taras
ID: 40016784
Rey.

I mean what I said; you did not read my question.

I did not ask how to update one combo box with new value that is not one of values of list value or is not in the table/query depends what source combo box have.

I asked how to add new values in combo boxes that are connected as cascading combo boxes.
It means Selection that you pick up in cboA drives options in cboB and selection that you pick up in cboB drives option in cboC.

Now I want to give a user option  during entry data process on the form to add new value  in existing values in those combo boxes, not just to pick up one of those that are already in box A,B or C.
For not cascading combo box I will use Not in the List event, I know how to do that.
However those are cascading combo boxes as I said in question . Not single combo box with list value or table/query  as a source.
How to do this ?
0
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 40017173
I don't really understand your question either (and yes, I did read it, a couple of times).

The concept of "cascading" combos has no impact on adding new values. You can add new values to "cascading" combos just like you do any combo, by using the NotInList event (and you've indicated you know how to do that). The only issue you'd find would be that the newly added values would not necessarily be related to any upstream or downstream values, although you can enforce that relationship if needed.

Are you trying to relate values in downstream combos to the newly added values? So if I add a value of "Canada" to my ShopCounty combo, it should then be related to "Ontario", "Peterboro", etc etc? If so, then that would happen only if you've enabled that relationship at the table level (i.e. you've associated Ontario and Peterboro with the Country "Canada"). You could certainly force that relationship when the user adds new values, but you'd need a form to handle that. So your NIL event would show the user that form, and they'd add the new Country, and associate all relevant items in the cboShopState table with the new country.

If not, then please give a real-world scenario of what you're trying to achieve.
0
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 40017256
<Not single combo box with list value or table/query  as a source.>
so, how do you select a value from cboA?
0
 

Author Comment

by:Taras
ID: 40017611
Scott.
I am doing that second part that you referring to.
Let say I have tables tblCountry, tblState, tblCity.  I can create relationship between them and enforce referential integrity.
 
Let say in table Country I have three entries Germany, USA, France.
When I pick up country USA I have only four states (Michigan, Texas, Arizona, Colorado) showing in State combo box those ones that I have shops in not all states.

Then when I pick up one of those states e.g. Michigan then in City combo box I have only e.g. five cites, those five are cites  that I have shops in  from state Michigan.


Following your suggestion let say
Now I want to add new shop in city Peterborough that is in province/state Ontario that is in country Canada.
You are suggesting to do that trough new form that will pop up at NIL of combo box cboCountry.
Then this new form will have fields for entering new Country , State/Province  and  City ?

Can you give me more detail or one example what do next. I have some clue but not sure is this ok or possible??

Are you suggesting on this new form those tree boxes for entering new Country, State and City to be combo boxes or simple text boxes?
Let say they are combo boxes, then why I need to go at NIL  to this new  form when I had those three combo boxes on existing form.
Further
If they are combo boxes on this new form,  then combo box cboCountry is base on tblCountry and  cboState and cboCity are based on queries as we need cascading connection.
Those two  queries will have foreign keys in that will come from cboCountry(query for cboState record source) and cboState(query for cboCity record source)
Then in after update event of each of those three combo boxes I will do require of other two.

Is that proper and possible way to try??
0
 

Author Closing Comment

by:Taras
ID: 40027637
Thanks.
0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

832 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question