List box controls

F

Fay Yocum

I have a form that has a combo box that selects a class name. Then there is
a list box that shows session of classes by that name. Then there is a
subform that is to show the roster of those that attended the session. It
almost works. When there is only one session of the class the roster is
displayed as it should. If there is more than one session I do not get the
roster.

The form and list box is based on qrySessionRosterPicker. The list box row
source is SELECT qrySessionRosterPicker.ClassName,
qrySessionRosterPicker.DateOfClassStart, qrySessionRosterPicker.TimeStart,
qrySessionRosterPicker.ClassNumber FROM qrySessionRosterPicker ORDER BY
qrySessionRosterPicker.ClassName, qrySessionRosterPicker.DateOfClassStart
DESC , qrySessionRosterPicker.TimeStart DESC;

There are 4 visible columns, column 4 is the bound column.
On the list box's click event I run Me.Requery.

Why can't I see the roster when there is more than one session in the list
box? Thank you for your help.

Fay
 
F

Fay Yocum

Thanks Allen all it took was to clear the Link fields and it worked like a
charm. This is the first time I have tried using a list box. Again thank
you. Fay
 
A

Allen Browne

You are trying to use a multi-select list box as the LinkMasterFields for a
subform?

I don't believe that will work. Instead, clear the
LinkMasterFields/LinkChildFields properties from the subform control, and
use the AfterUpdate event procedure of the list box to create a SQL
statement to assign to the RowSource of the subform.

For an example of how to build the WHERE clause for the multiselect list
box, see the code in this link:
http://members.iinet.net.au/~allenbrowne/ser-50.html

Note that you may have to programmatically clear the
LinkMasterFields/LinkChildFields properties again after assigning the
RowSource, as Access is likely to be overly helpful and assign these again.
 

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