Creating a class roster from a combo box (1 Viewer)

Oracle741

New member
Local time
Today, 17:57
Joined
Jul 3, 2013
Messages
7
I have been working on a training database, and keep trying to find a solution to the following problem:

I have a form that the Training Admin will use to select students to a new class.

they select the Class Name from a ComboBox tied to TblClass

they select an Instructor from a ComboBox tied to TblInstructor

and then, I am trying to to use some method to select students by identifying information (EmplID, LName, FNAme, MName, EMP# from TblEmployee) one at a time (from a combo box, or some other easy select method) that will pass the students information to a list, viewable and editable (remove a name) before it is committed to a TblCompletedTraining

I looked at a cascading combo-boxes, and that looks like a good method to selecting from the large number of employees in TblEmployee, but I am unsure how to store each selection on the form, and then allow the Training Admin the ability to delete members from the pool prior to committing.

I am reluctant to use the multivalue field as a solution for a couple of reasons;

1. lots of discussion stating it is a bad idea.
2. It explicitly states to be used for relatively short lists only (no value limit given; so I assume 100 or less items)
3. will probably need to covert this database sometime in the future.

I thought I had figured this out, by using a combo-box selection to generate a filter, but it leaves me with only one selection in the end...

I am probably just missing the obvious; any and all help is appreciated;).
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:57
Joined
Aug 30, 2003
Messages
36,139
Have you considered a multiselect listbox?

http://www.baldyweb.com/MultiselectAppend.htm

Do do what you're describing, you'd need to use a local table to temporarily store the selected items, then append them from there to the actual data table behind your commit button.
 

spikepl

Eledittingent Beliped
Local time
Today, 23:57
Joined
Nov 3, 2010
Messages
6,142
To manage selection of multiple students I have two listboxes, each using multiselect as suggested by Paul: Left-hand one showing the students on the roster (initially none), and the RH one showing all students, that have not yet completed the class. A button between the two moves/removes students from one listbox to the other listbox.

Actually, to add students to the roster I add them to the underlying query [Correction: table, of course], and requery the listbox.

The query showing untrained students excludes the ones already trained in this class, and also ones currently shown in the roster.
 

Attachments

  • New Picture.png
    New Picture.png
    90.4 KB · Views: 212

Oracle741

New member
Local time
Today, 17:57
Joined
Jul 3, 2013
Messages
7
spikepl,

that is exactly what I was envisioning. Would you be willing to share the 'magic behind the curtain' for that form?

And when I say exactly, I am not exaggerating; I also need to filter students by a JobCode, and each JobCode has a different training need. Your 'select department' field could work in a similar manner for what I am doing. Brilliant!
 

Oracle741

New member
Local time
Today, 17:57
Joined
Jul 3, 2013
Messages
7
The query showing untrained students excludes the ones already trained in this class, and also ones currently shown in the roster.

I have been reverse engineering the form, but this last statement has me a bit confused. Can anyone clarify? I mean I am not sure how I would trigger this query/ arrange it in the form.:confused:
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:57
Joined
Aug 30, 2003
Messages
36,139
Not my quote, but presumably means that if I have taken class xyz, I will not show up on the list of untrained students.
 

Oracle741

New member
Local time
Today, 17:57
Joined
Jul 3, 2013
Messages
7
Thanks Paul, what I suppose I am lacking is what would the code be to call a particular query.

I think the best place for it would be CurrentRosterList: event: after update?

Oh, and thanks for the Multiselect listbox idea. Perfect way to go.

Ken
 

pbaldy

Wino Moderator
Staff member
Local time
Today, 14:57
Joined
Aug 30, 2003
Messages
36,139
No problem Ken. As to where the code would be, that would depend on the methodology, but certainly the listbox after update event is a candidate. From the look of it, spikepl probably has code behind the buttons.
 

spikepl

Eledittingent Beliped
Local time
Today, 23:57
Joined
Nov 3, 2010
Messages
6,142
I will not share the code because there are many features involved here that are not apparent from the screen shot, and I would have to disentangle them. Wait 6 weeks and get this app (no source code though) at a very reasonable price :D

The mechanics are not very complex ...apply some logic and you'll get the answer. But if not then just ask - I don't mind answering stuff that is not obvious from documention.
 

Users who are viewing this thread

Top Bottom