Cascading Combo Boxes

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?
 
J

Jeff Boyce

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
 
G

Guest

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?
 

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