Filter DropDown Menu

  • Thread starter Thread starter Katrina
  • Start date Start date
K

Katrina

I would like to create a drop down menu to be used in
filtering.
I know that there is the filter lookup property, but I
don't want the dropdown list to show all the values in
the table.
I want to make filtering easier. I would like to add a
list like:

Like "*analysis*"
Like "*Design*"

to give people help in filtering.

I don't want to create a dropdown on the form view (just
the filter view), and I don't want to get very
complicated, I'm just testing the waters to see if
there's a simple way to do what I'm looking for.

THanks for any help,
Katrina
 
It really is quite simple. I did something like this in a time
tracker I whipped up pretty darn quick, and this is the only code I
have in the app.

My combo box just uses the default name. For me, I grab the "value",
though if you have to there are ways to grab any column that you wish.
Ie. You can grab column 3 or the dropdown if you want. Just using the
value makes life a bit easier tho.

Private Sub Combo2_AfterUpdate()
Me.Filter = " TaskId = " & Me.Combo2.Value
Me.FilterOn = True
End Sub

Your rowsourde for your combo might look something like :
rowsource = " '*analysis*';'All Analysis';'*Design*';'Design It!' "

and your filter statement would be :
sValue = "'" & nz(me.combo2.value, "*") & "'"
Me.Filter = " ProjectPhase LIKE " & sValue

There may be a more 'optimal' way of doing it than setting the
filterOn to true each time, but it seems to work alrite :) Also, you
should of course make sure that the quoting is proper.

Good luck,
Andrew Backer


I would like to create a drop down menu to be used in
filtering.
I know that there is the filter lookup property, but I
don't want the dropdown list to show all the values in
the table.
I want to make filtering easier. I would like to add a
list like:

Like "*analysis*"
Like "*Design*"

to give people help in filtering.

I don't want to create a dropdown on the form view (just
the filter view), and I don't want to get very
complicated, I'm just testing the waters to see if
there's a simple way to do what I'm looking for.

THanks for any help,
Katrina

..--------------------------------------
| Andrew Backer
| abacker _@_ comcast _dot_ net
`--
 
Back
Top