UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Filtering one combo with another just ain't workin!!    
 
   
JVanKirk
post Feb 22 2006, 09:06 AM
Post #1

UtterAccess VIP
Posts: 3,872
From: Fort Drum, NY



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
Go to the top of the page
 
+
fkegley
post Feb 22 2006, 09:12 AM
Post #2

UtterAccess VIP
Posts: 23,583
From: Mississippi



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
Go to the top of the page
 
+
JVanKirk
post Feb 22 2006, 09:19 AM
Post #3

UtterAccess VIP
Posts: 3,872
From: Fort Drum, NY



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
Go to the top of the page
 
+
JVanKirk
post Feb 22 2006, 09:20 AM
Post #4

UtterAccess VIP
Posts: 3,872
From: Fort Drum, NY



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

Thanks,

Jason
Go to the top of the page
 
+
fkegley
post Feb 22 2006, 09:54 AM
Post #5

UtterAccess VIP
Posts: 23,583
From: Mississippi



Jason, I did mean to type Row Source rather than Control Source. Sorry for the mistake. I guess not enough coffee this morning yet.
Go to the top of the page
 
+
fkegley
post Feb 22 2006, 09:54 AM
Post #6

UtterAccess VIP
Posts: 23,583
From: Mississippi



Great, you're welcome. I am glad I was able to help.
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 19th May 2013 - 11:35 PM