S
Stewart Saathoff
Hello,
I have a very odd problem with a ComboBox. When I select a record from the
ComboBox, incorrect information is returned to me. Let me explain the combo
and its function with the Subform.
Parent Form ComboBox - cboCompany
Child Form ComboBox - cboStudent
cboCompany's RowSource - SELECT Customers.CustID, Customers.Name FROM
Customers ORDER BY [Name];
cboStudent's RowSource - SELECT Students.StudentID, Students.Display FROM
Students WHERE (((Students.CustID)=Forms!frmClasses!cboCompany)) ORDER BY
Students.Display;
Here is a list of Sample data for cboCompany
CustID | Name
____________________
3 | Microsoft
1 | Oracle
2 | Sun
When I select Microsoft, Oracle's student list is returned.
When I select Oracle, Sun's student list is returned.
When I select Sun, Microsoft's student list is returned.
As you can see from this sample, cboStudent is setting the CustID value of
the Query to the actual row number of the items in the ComboBox, not their
CustID.
If I remove the Order By clause in the cboCompany Rowsource, the correct
information is returned, but I want to sort the companies Alphabetically...
Any thought's would be appreciated....
I have a very odd problem with a ComboBox. When I select a record from the
ComboBox, incorrect information is returned to me. Let me explain the combo
and its function with the Subform.
Parent Form ComboBox - cboCompany
Child Form ComboBox - cboStudent
cboCompany's RowSource - SELECT Customers.CustID, Customers.Name FROM
Customers ORDER BY [Name];
cboStudent's RowSource - SELECT Students.StudentID, Students.Display FROM
Students WHERE (((Students.CustID)=Forms!frmClasses!cboCompany)) ORDER BY
Students.Display;
Here is a list of Sample data for cboCompany
CustID | Name
____________________
3 | Microsoft
1 | Oracle
2 | Sun
When I select Microsoft, Oracle's student list is returned.
When I select Oracle, Sun's student list is returned.
When I select Sun, Microsoft's student list is returned.
As you can see from this sample, cboStudent is setting the CustID value of
the Query to the actual row number of the items in the ComboBox, not their
CustID.
If I remove the Order By clause in the cboCompany Rowsource, the correct
information is returned, but I want to sort the companies Alphabetically...
Any thought's would be appreciated....