Google Groupes n'accepte plus les nouveaux posts ni abonnements Usenet. Les contenus de l'historique resteront visibles.

Multi-Select List Box

25 vues
Accéder directement au premier message non lu

Rambyte

non lue,
10 août 2002, 12:53:2810/08/2002
à
The subform on a form (ClassStudents) contains a list of students enrolled
for a specific class. Rather than entering the students into the subform, a
MultiSelect list box would simplify the data entry process. This would be
the first time I've worked with this control.

I've created a new form containing only the MultiSelect ListBox control. The
user will activate this form by clicking a button on the ClassStudents form
entitled "Add/Remove Students." With the MultiSelect form, the user can then
select or de-select one or more students from the list.

As the MultiSelect form opens up, how do I pre-select the students in
the list that are already enrolled in the class?
When the user clicks the OK button on the MultiSelect form to return to
the ClassStudents form, how can I determine which students were removed from
the list and which students were added to the list?


Don P. Mellon

non lue,
10 août 2002, 22:31:5510/08/2002
à

Too complicated. Use the subform in the ClassStudents form to add or remove
students.

What you describe sounds to me like a basic retail order form configuration.
The class is the order; the students are the products, which is not
farfetched when you think about it.

I would put a combo box in the subform with the combo box's row source
pulling all the available student names (and probably student IDs). The
user simply works through the subform, picking a student name for each
record. To remove a student, place a little button in the subform that
deletes the current record. (The button is really unnecessary because
standard Access commands can do the same thing.)

[Even if you do not like my idea, you still do not need the second,
"MultiSelect Form." You should put your student multiselect list box in the
subform or in the ClassStudents parent form.]


"Rambyte" <Roger...@Cox.net> wrote in message
news:cyb59.11722$eb.11...@news2.west.cox.net...

rkc

non lue,
11 août 2002, 00:50:5111/08/2002
à

"Rambyte" <Roger...@Cox.net> wrote in message
news:cyb59.11722$eb.11...@news2.west.cox.net...

> As the MultiSelect form opens up, how do I pre-select the students in


> the list that are already enrolled in the class?
> When the user clicks the OK button on the MultiSelect form to return to
> the ClassStudents form, how can I determine which students were removed from
> the list and which students were added to the list?

This isn't what would be called a standard way of doing things so your
question does not have a simple answer. You would start by reading up
on how multi-select list boxes work and how you deal with them using
VBA. You need to learn about things like the ItemsSelected collection
and the ItemData, Selected, and ListCount properties.

On top of that you'll probably need to learn about the RecordsetClone
property of a bound form and how to address the subform's RecordsetClone.
Then you'll need to read up on the DAO Recordset object and the methods
used to Add, Delete and Update records.


Rambyte

non lue,
11 août 2002, 11:01:5311/08/2002
à
It looks as though I found my solution. I found an example of what I am
trying to do on Roger Carlson's Access site. Look for the item called
ListBoxSetTableValue.mdb. I downloaded it, looked at the code and was able
to adapt it to my application. Thank you Mr. Carlson.
http://www.rogersaccesslibrary.com/TableOfContents.asp


"Rambyte" <Roger...@Cox.net> wrote in message
news:cyb59.11722$eb.11...@news2.west.cox.net...

0 nouveau message