473,219 Members | 1,814 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,219 software developers and data experts.

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 4845

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******@pcdatasheet.com
www.pcdatasheet.com

"Joe" <jc**********@comcast.net> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.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
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...
1
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...
3
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() {...
4
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...
3
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...
5
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...
16
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...
1
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 ...
1
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 ,...
5
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...
0
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.