Feb 22 2006, 09:06 AM
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.
Feb 22 2006, 09:12 AM
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:
Feb 22 2006, 09:19 AM
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
ORDER BY tblItems.Item;
Anyway, I'll go try this now.
Maybe I put the Requery at the wrong spot last time.
Feb 22 2006, 09:20 AM
Frank, that was it, for some reason it liked afterupdate better than on the OnClick event.
Feb 22 2006, 09:54 AM
Jason, I did mean to type Row Source rather than Control Source. Sorry for the mistake. I guess not enough coffee this morning yet.
Feb 22 2006, 09:54 AM
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