limit the data by comboBox

T

t848

In your combobox properties there in a selection that says LIMIT TO LIST
select this option
 
T

Tim

Sarah, there are a number of ways to do this. It would depend on what
data you are trying to filter. If you mean that you have an unbound
combo box (combo box where the "Control Source" in properties is
blank), and you would like the data-set that the form displays to be
filtered based on this selection of this combo box....

You would use the After Update event on your combo box, something like
this:

Dim strFilter as String
strFilter = [Forms]![[Your Form]![Your combo box name]
Me.Filter = strFilter
Me.FilterOn = True

The Me.Filter thing will toggle it on your filter on and off, so it's
good for a command button. Triggering it nicely with a combo box
would probably involve modification of this. I'm still learning too
:)
 
S

sg

Hi,

I have a form (selectDepart) to ask user to choose department from the
comboBox list. And I like to pass this value to my database to limit the
data to just this choice. If user select 'All', all data would be available
to user. I'm still learning, please help.

Thanks in advance,
Sarah
 
Top