Cascading combos with multiple rows

Bodestone

New member
Local time
Today, 20:54
Joined
May 22, 2008
Messages
3
I have found lots of information on cascading combos but none for this particular issue.
Basically when you have multiple rows where each row may need the second combo in the cascade to have a a different set of values.

In my case I have a table StockTypeList with columns StocktypeID, StocktypeText. Another table StockList, columns StockID, StockText, StocktypeID.

The form is bound to the table StockInventory with relevant fields StockInventoryId, StockTypeID, StockID.

StockInventoryID is auto numbered.

If I have multiple records in StockInventory I have the following problem:
When the Stock combo gets requeried in any row by changing the stock type then any other row that has a different stock type has the Stock combo emptied because it's value is not valid in the new stock list.

Example rowsource code and screenshot for reference:
Code:
Me.cboStock.RowSource = "SELECT StockList.StockID, StockList.StockText
FROM StockList 
WHERE StockList.StockTypeID = " & Me.cboStockType.Column(0) & "And StockList.IsActive=1 ORDER BY StockList.StockText;"
attachment.php


Is there any way to requery only the combo for the current row?
 

Attachments

  • stock.gif
    stock.gif
    2.4 KB · Views: 280
I have found lots of information on cascading combos but none for this particular issue.
Basically when you have multiple rows where each row may need the second combo in the cascade to have a a different set of values.

In my case I have a table StockTypeList with columns StocktypeID, StocktypeText. Another table StockList, columns StockID, StockText, StocktypeID.

The form is bound to the table StockInventory with relevant fields StockInventoryId, StockTypeID, StockID.

StockInventoryID is auto numbered.

If I have multiple records in StockInventory I have the following problem:
When the Stock combo gets requeried in any row by changing the stock type then any other row that has a different stock type has the Stock combo emptied because it's value is not valid in the new stock list.

Example rowsource code and screenshot for reference:
Code:
Me.cboStock.RowSource = "SELECT StockList.StockID, StockList.StockText
FROM StockList 
WHERE StockList.StockTypeID = " & Me.cboStockType.Column(0) & "And StockList.IsActive=1 ORDER BY StockList.StockText;"
attachment.php


Is there any way to requery only the combo for the current row?
Honestly, this description of yours is incredibly confusing. You might get more help if you just uploaded the file that has this form in it.

Mark-ups on your GIF's might help us too (as in, annotations from a program like Acrobat to help with the description of the problem).
 
Firstly thanks for the swift response and sorry if I was not clear. It seemed OK to me and the proof reader but we both know the front end in question.

Had to do a quick mock-up from memory since I am not at in the office just now and anyway it's a small part of a fairly big access front end to a SQL server DB.

This should illustrate the issue nicely. The requery code is in the getfocus event for the Stock combo for now.

Basically what I am looking for is for each instance of the stock combo to be populated with the relevant Stock based on the corresponding Stock Type. I looked for some kind of control array property but to no avail. I am sure I am missing something very simple somewhere.
 

Attachments

Users who are viewing this thread

Back
Top Bottom