Cascading Combo Boxes

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have three cascading combo boxes.

The first is:
RFQNo

ROWSOURCE:
SELECT DISTINCT LineItem.RFQNo FROM LineItem ORDER BY [RFQNo];

EVENT PROCEDURE:
Private Sub cboRFQ_AfterUpdate()
Me.cboChange.Requery
End Sub

The Second is:
Change

ROWSOURCE:
SELECT DISTINCT Change FROM LineItem WHERE RFQNo=Forms![RFQ
Selection]!cboRFQ;

EVENT PROCEDURE:
Private Sub cboChange_AfterUpdate()
Me.cboLine.Requery
End Sub

The Third is:
LineItem

ROWSOURCE:
SELECT DISTINCT LineItem FROM LineItem WHERE Change=Forms![RFQ
Selection]!cboChange;


The first and second cascading combo boxes work well.

The third is not working correctly. It provides more options than are
available specific to the second box (Change). It seems to be providing all
LineItem numbers based on all change numbers in the table that match the
second combo box (Change).

How do I get the third combo box to select only the LineItems specific to
both the RFQNo and the Change number?
 
Alter the SQL statement to use both the first and second comboboxes' values,
instead of only the second's.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
Thanks Jeff,

That worked!

Jeff Boyce said:
Alter the SQL statement to use both the first and second comboboxes' values,
instead of only the second's.

Regards

Jeff Boyce
Microsoft Office/Access MVP

Nanette said:
I have three cascading combo boxes.

The first is:
RFQNo

ROWSOURCE:
SELECT DISTINCT LineItem.RFQNo FROM LineItem ORDER BY [RFQNo];

EVENT PROCEDURE:
Private Sub cboRFQ_AfterUpdate()
Me.cboChange.Requery
End Sub

The Second is:
Change

ROWSOURCE:
SELECT DISTINCT Change FROM LineItem WHERE RFQNo=Forms![RFQ
Selection]!cboRFQ;

EVENT PROCEDURE:
Private Sub cboChange_AfterUpdate()
Me.cboLine.Requery
End Sub

The Third is:
LineItem

ROWSOURCE:
SELECT DISTINCT LineItem FROM LineItem WHERE Change=Forms![RFQ
Selection]!cboChange;


The first and second cascading combo boxes work well.

The third is not working correctly. It provides more options than are
available specific to the second box (Change). It seems to be providing
all
LineItem numbers based on all change numbers in the table that match the
second combo box (Change).

How do I get the third combo box to select only the LineItems specific to
both the RFQNo and the Change number?
 
Back
Top