Multi-Select List Box

G

Guest

I read and read the newsgroups, but I can't seem to wrap my head around
multi-select list boxes.

I have a form based on tblStudentData. I want to have subForms open up in
ListBox form to select values for student interventions the child/parent
field would be PeimsIDNum. These interventions are stored in a seperate
table, tblInterventions.

tblInterventions has 2 fields, ModID (auto#) and Modification (text 50 chars)

I guess I can't see how the table would relate to the main tblStudentData.
I have used subforms before except that I just used continuous forms and the
"Modification" control field changed to a combo-box from another table that
stored the actual modifications. 1 Record for each modification.

I try to learn something new with each project, so how do I use the
Multi-Select option in this case? I can't seem to understand how the
multi-select works. Anyone care to explain? I would appreciate the effort.
 
R

Roger Carlson

G

Guest

Ripper,

There are two issues:

1. You need another table to store the child records associated with each
student, called say, tblStudentInterventions:

StudentInterventionID AutoNumber (PK)
StudentDataID Number (Foreign Key to tblStudentData)
ModID Number (Foreign Key to tblInterventions)

tblInterventions stores all of the possible values of interventions, serving
as a "lookup" table for your list box.

2. A listbox, like any other control, can only have a single value. If it
is bound to a field, a selection will be stored in the underlying field only
if MultiSelect is set to None. To use a listbox to store multiple values,
you must use VBA code to insert records into your detail table. The
following link shows you how to do this, however, I normally find it more
straightforward to use a continuous form with a combo box for this purpose.

http://www.fontstuff.com/access/acctut11.htm

Hope that helps.
Sprinks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top