Odd issue with Combo Box and Subform

  • Thread starter Thread starter Stewart Saathoff
  • Start date Start date
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....
 
Nevermind, I got it.

I had set the BoundColumn property on some ComboBoxes on another form to be
0 instead of 1...

Thanks anyways...
 
Back
Top