473,581 Members | 2,786 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Populate multi-list box based on selections in a different multi-list box

Joe
I have 2 multi-list boxes, 1 displays course categories based on a
table called CATEGORIES. This table has 2 fields CATEGORY_ID,
CATEGORY_NAME

The other multi-list box displays courses based on a table called
COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME.

The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES.

I want to populate the course list box based on any category(s)
selected in the 1st multi-list box. How would I go about doing
something like this?

Nov 13 '05 #1
6 4874

Joe wrote:
I have 2 multi-list boxes, 1 displays course categories based on a
table called CATEGORIES. This table has 2 fields CATEGORY_ID,
CATEGORY_NAME

The other multi-list box displays courses based on a table called
COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME.

The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES.

I want to populate the course list box based on any category(s)
selected in the 1st multi-list box. How would I go about doing
something like this?


beats the hell outta me why you'd use a listbox when you can only
select a single value - (use a combobox instead!), but here's the
code...
http://www.mvps.org/access/forms/frm0028.htm

Nov 13 '05 #2
Joe
These are both multi-list boxes where the user can select multiple
values in both boxes. If the user selects 3 course categories for
example, I want the 2nd multi-list box to be populated with all the
courses under those 3 categories and be able to choose as many courses
as needed.

Nov 13 '05 #3
Joe wrote:
These are both multi-list boxes where the user can select multiple
values in both boxes. If the user selects 3 course categories for
example, I want the 2nd multi-list box to be populated with all the
courses under those 3 categories and be able to choose as many courses
as needed.


But...a multi-select ListBox's selections can only be retrieved with code as it
will always have a value of Null. Is it your intention that the multiple
selections made in the second ListBox be stored somewhere?
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #4
Joe wrote:
I have 2 multi-list boxes, 1 displays course categories based on a
table called CATEGORIES. This table has 2 fields CATEGORY_ID,
CATEGORY_NAME

The other multi-list box displays courses based on a table called
COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME.

The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES.

I want to populate the course list box based on any category(s)
selected in the 1st multi-list box. How would I go about doing
something like this?
You write code in the after_update event of the first listbox that uses
the .selected property to build a query expression which you set as the
rowsource property of the second listbox.
From Access 97 Help: The Selected property is an array of values from 0

to the ListCount property value minus 1. For each item in the list box
the Selected property will be True (-1) if the item is selected and
False (0) if it is not selected.

Bob

Nov 13 '05 #5
Joe,

I have developed a calendar schedule module that I thought you might be
interested in having it implemented in your database. It was developed for a
database used to schedule training classes. The training facility can be
selected to limit the training classes displayed in the calendar to a
specific facility. You can change the month and year of the calendar to
limit the training classes displayed in the calendar to a specific year and
month in that year. By simply making a new selection in one of the
drop-downs, you can change what faciity the training classes are diaplayed
for and what month and year the training classes ocurred. To schedule a new
class, you click on one or more dates for the class in the calendar and then
click the "Schedule" button in the menu at the top of the screen. The
"Schedule" button opens a form to add a new training class on the dates you
previously selected. You can also click on any day to edit the schedule of
the classes shown on that day. At any time, you can click on Print in the
menu at the top of the screen and printout the calendar that is on the
screen. The calendar schedule module can be easily modified to meet your
specific needs. I can email you a screen shot of the calendar schedule
module if you are interested.
PC Datasheet
Your Resource For Help With Access, Excel And Word Applications
re******@pcdata sheet.com
www.pcdatasheet.com

"Joe" <jc**********@c omcast.net> wrote in message
news:11******** **************@ c13g2000cwb.goo glegroups.com.. .
I have 2 multi-list boxes, 1 displays course categories based on a
table called CATEGORIES. This table has 2 fields CATEGORY_ID,
CATEGORY_NAME

The other multi-list box displays courses based on a table called
COURSES. This table has 2 fields CATEGORY_ID, COURSE_NAME.

The CATEGORY_ID is a FK in COURSES and a PK in CATEGORIES.

I want to populate the course list box based on any category(s)
selected in the 1st multi-list box. How would I go about doing
something like this?

Nov 13 '05 #6
Joe
Both multi-list boxes are displaying table data. For example. when the
form loads, the category multi-list box is loaded from a table and the
categories for the current student are selected in the multi-list box.
I have that working correctly by VBA code on the the form's current
property.

After the categories are selected, I want to make the course multi-list
box visible, load it with courses related to the selected categories
only.

All data loaded in the multi-list boxes will be stored in seperate,
related tables.

Nov 13 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
18060
by: C. David Rossen | last post by:
Hello: I have a registration form for classes. Each class has a fee. I have a drop down box whereby the user chooses his class. There is a textbox with the associated fee. I would like to auto populate the fee textbox depending on what class the user chooses. In the email, the value of the drop down box has to be the name of the class...
1
1594
by: picarama | last post by:
hi i created a form in outlook 2000 hoping that i can populate with data stored in access 2000. however, i don't know the steps to populate the outlook form!? any advise or direction to specific websites would be appreciated! thanks in advance!!
3
3518
by: Girish | last post by:
How do i populate a static hastable without the need to instantiate the class? any ideas? Im confused. class VAErrorMap { static Hasttable _ErrorMap = new Hashtable(); public VAErrorMap() { //populate has here.. but dont want to!
4
2995
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be added to the data grid. My current code is coming up with errors, dt and drv are unknown in the else part of the if statement. if...
3
2686
by: Yul | last post by:
Hi, We are in the process of designing an ASP.NET app, where a user will enter some 'Customer ID' to be queried in the database. If the ID is valid, several stored procedures will be called to populate multiple webpages containing customer information. There isn't a one-to-one correlation between the stored procedure and a webpage. In other...
5
1887
by: John A Grandy | last post by:
is it possible to write a vb.net code (intended to run on the client-side) that would invoke an instance of IE, have it download a page from a certain URL, and then pre-populate some of the controls on that page, before transferring focus to the browser-page and showing it to the user? (the user would be responsible for submitting the page.)
16
10494
by: agrawal.solutions | last post by:
Hello Friends I am asking a very silly question but i dont find any solution fo this.. I am selectiong a recordset and want to populate a combobox where id would be inviseble and the content would. I am getting the recordset and the no of record but then i am unble to populate the combobox. I have already tried all the function starting...
1
1590
by: indhu | last post by:
Hi all, I want 2 know, how to populate using 2 combo box to populate other field. right now am using click event of combo to populate the other field but i want to select both combo1 and combo2 when these 2 r equal then it populate other fields. Private Sub scene_txt_Click() 'combo name scene_Txt
1
3940
by: ramel | last post by:
Hi all, I have a problem related to javascript , ajax and jsp. Please see this url http://xil.co.in/print_screen_2.JPG. I am working on this form. There are some buttons (like submit , add ,edit at bottom of this page , but not visible in printscreen). On click of a radio button on left side , form fields on right side and small...
5
2777
by: jazznojive | last post by:
I've created a textbox control on a userform and I am trying to figure out how to make the text populate to a worksheet range in sequence automatically. I've figued out how to get the text that the user types in to populate in a specific range, but I'd like each entry from the user to populate on the next cell below the previous entry...
0
7882
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...
0
8157
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. ...
0
8312
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6564
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5366
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...
0
3809
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...
1
2309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1410
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1145
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.