473,395 Members | 2,423 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,395 software developers and data experts.

Creating a dropdown list box that will call another dropdown list box in access.

Hello All,
I am creating a date base in access. I want to create a dropdown list box that is connected to another dropdown list box.
You start with a dropdown list that has 5 choices and each of these choices will call another dropdown list box when one of the choices from the first gets selected. (I hope this makes sense)

All of this is being done on a single form.
I know how to make a (sub) dropdown list not seen before the action and disappear after the action. I do not know the coding for a sub dropdown list box.
If there is a website that covers this that would be great, or if some one know the name of the action I am trying to do that would be great. I have been trying to search the web and by library for any clues but I am coming up short.
I really appreciate the help.
Mar 4 '08 #1
3 2782
VBWheaties
145 100+
Where are the other values stored? In a table?
Mar 4 '08 #2
all the values are stored In the same table.
Mar 4 '08 #3
VBWheaties
145 100+
all the values are stored In the same table.
Many ways to do this.

My approach would be to create a global dictionary containing key/value pairs where the value is a delimited sequence of data that should be inserted into the other combobox.

In other words, something like

Expand|Select|Wrap|Line Numbers
  1. Public d As New Dictionary 'Scope to global (public) so we can use the dictionary elsewhere in code. 
  2.  
  3. '**set a reference to Microsoft Scripting Runtime or scrrun.dll 
  4. '   otherwise, declare d as variant and set it to CreateObject("Scripting.Dictionary")
  5.  
  6. d.add "Combo1KeyText", "Value1^Value2^Value3^Value4"
  7. d.add "Combo2KeyText", "Value1^Value2" 
  8. d.add "Combo3KeyText", "Value1^Value2^Value3" 
  9.  
Then, capture the comboboxes changed event and load the Values list into the other combobox.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Combo1_Change()
  2.    Dim sValues As String 
  3.    Dim varValues
  4.    Dim i as Integer
  5.    If d.Exists(Combo1.Text) Then 'd is our global dictionary object
  6.       Combo2.Clear 
  7.       sValues = d(Combo1.Text) 
  8.       varValues = Split(sValues, "^") 
  9.       For i = 0 to ubound(varValues)
  10.          Combo2.AddItem varValues(i) 
  11.       Next i 
  12.    End If 
  13. End Sub
  14.  
Mar 4 '08 #4

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

Similar topics

1
by: Joseph Barron | last post by:
Here is a SIMPLE problem that I'm trying to solve. It works in Netscape 6.2, but IE6 gives ""No such interface supported." Below are page1.htm and page2.htm . In page1.htm, there are two...
9
by: Harry | last post by:
I am accumulating over 80 pages per day into an archive that I will need to be able to present sequentially to viewers. Using html to viewing a page, then click on back to return to my archive...
3
by: Charles | last post by:
I am trying to add the ability for a user to change the order in which the elements are listed in a dropdown list box. Before I added the ListID field the dropdown list box order was controlled...
8
by: Kris Rockwell | last post by:
Hello, I have done the following to bind data to a DropDown box: 1. Drag SQLServer table onto web form to create data connection and data adapter. 2. Generate dataset by right-clicking on...
6
by: Mark | last post by:
I have two dropdown lists. Both have autopostback set to true. In both dropdowns, when you select an item from the list, it redirects to the Value property of the dropdown. Nothing fancy. ...
2
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was...
1
by: Alex | last post by:
Hi Everyone -- I have two tables, one has a list of Items and one a list of Bidders. I'm creating a Form to allow the user to select the Bidder Name from a dropdown list. I want the Bidder Name...
9
by: Tarscher | last post by:
hi all, I have this seemingly simple problem. I have lost a lot of time on it though. When a user selects a value from a dropdownlist (static control) a dynamic control is generated. I have...
5
by: abhi3211 | last post by:
i am using java inside java script page. in that page i want to use two dropdown list. in first dropdown list i am getting data from ms-access database. in second dropdown list i want to get data...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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,...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.