Mr. Vinson -
My form named frmAssignStudentsToClass has a subform named
sfrmAssignStudentToClass. Inside my subform I have a combo box named
cboClass with the row source based on the following query:
SELECT Classes.ClassID, Classes.ClassName FROM Classes ORDER BY [ClassName];
The other combo box is named cboDay and its row source is based on this query:
SELECT Sessions.SessionID, Sessions.Day, Sessions.ClassID FROM Sessions
WHERE
(((Sessions.ClassID)=Forms!frmAssignStudentsToClass!sfrmAssignStudentsToClass!cboClass)) ORDER BY Sessions.Day;
I think I am following your suggestion correctly, but when I run my form, I
get an input box asking me to type in a value for
"Forms!frmAssignStudentsToClass!sfrmAssignStudentsToClass!cboClass"
John Vinson said:
Okay, I added another combo box that displays the session date, but I need it
to display the correct session dates given what is selected in the ClassName
combo box...so Class A is offered at noon and 2:00, when I select Class A, I
want the Date combo box to only display 12:00 PM and 2:00 PM. Right now it
displays every date and time.
Base the Sessions combo box on a query referencing the Class combo
box: use a criterion like
=[Forms]![MainFormName]![subformname].Form![ClassName]
using the name property of the Subform Control (which may or may not
be the same as the name of the form within that control).
You'll need to Requery the session combo in the AfterUpdate event of
the Class combo.
John W. Vinson[MVP]