View Full Version : How to filter combo box entries


arage
04-04-2001, 06:59 AM
How can I filter the entries in a combo box? And I don’t mean filtering one combo box based on the value of another combo box. I mean by some variable in vb code or something similar.

KevinM
04-04-2001, 08:03 AM
Create a "hidden text box" on your form and refernce this text box in the query criteria of the ComboBox.

HTh

Kevin M

arage
04-04-2001, 08:04 AM
will this work even when there are some default entries in the combo box to begin with?

arage
04-04-2001, 10:00 AM
Well I went to the combo box property sheet, clicked row source & updated the sql statement by adding this criteria to the field budgetcode. However, my combo box is not listing anything now, it’s empty. If global region code is 1199 then 11 is used to get all the budget codes where they have 11 in the specified positions mentioned in the mid ( ) function below.

mid(“budgetcode”,14,2)=Left(“globalregioncode”,2)

arage
04-04-2001, 12:01 PM
Hi,
I’m still working on the above. Just to re-phrase what I want to accomplish. My combo box has a default set of gl codes stored in it that a user can choose from. But for each user that enters info, there is a subset of gl codes they are restricted to. Right now, though, the user can pick ANY gl code rather than just the one he/she is restricted to.