Full Version: Filtering one combo with another just ain't workin!!
UtterAccess Discussion Forums > Microsoft® Access > Access Forms
JVanKirk
Interesting morning. I have a combobox (cboItem) on my form that is used to find a record. This combo box is filtered by the use of another combobox(cboInvSource). In cboInvSource you select where your inventory is coming from. Then cboitem is suppose to display just those items that are available through that source, which it does kind of. The first time I run through, cboitem will show only those available based on cboInvSource. If I select a new item from cboInvSource, I still get the same list in cboItem, it doesn't update. I placed an unbound text box controlled by cboInvSource.Value to ensure it was updating and that works fine. So then i modified the Source info for my cboItem so that the criteria under InvSourceID = txtInvSource.Value and it still doesn't work right. Only the first time.

Any ideas? I have set them up like this before and everything worked fine. Maybe I need to close Access and restart LOL.

Jason
fkegley
It sounds like you are using the control source of cboItem to fetch the value of cboInvSource. That is fine, but you will need to requery cboItem in the AfterUpdate event of cboInvSource.

Open the form in Design View, get the properties of cboInvSource. Click the Event page, then the AfterUpdate row, then the ... at the end of the row. Here is the code:

Me.cboItem.Requery
JVanKirk
I will try that code but it's not the control source, it the row source in cboItem. the rowsource is a query that looks like:
SELECT tblItems.ItemID, tblItems.Item, tblItems.InvSourceID
FROM tblItems
WHERE (((tblItems.InvSourceID)=[Forms]![frmInventory]![cboInvSource]))
ORDER BY tblItems.Item;

Anyway, I'll go try this now.

Maybe I put the Requery at the wrong spot last time.

Jason
JVanKirk
Frank, that was it, for some reason it liked afterupdate better than on the OnClick event.

Thanks,

Jason
fkegley
Jason, I did mean to type Row Source rather than Control Source. Sorry for the mistake. I guess not enough coffee this morning yet.
fkegley
Great, you're welcome. I am glad I was able to help.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.