Filter on a listox

  • Thread starter Thread starter Vsn
  • Start date Start date
V

Vsn

Hi all,

I was wondering; is it possible to apply a filter to a ListBox the same way
as is possible to a form recordsource?

Filter = "fID=1"
FilterOn=TRUE

Or are ther other methods so achieve the same?

Thx,
Ludovic
 
Vsn,
Apply your filter to the Row Source table/query behind the
listbox.
On a form, your Row Source query might have a criteria like

fID Like "*" & Forms!frmYourForm!YourTextControl & "*"

If YourTextControl is null, all records are returned to the listbox...
or if it contains a value, only those related records are returned.
--
hth
Al Campagna
Microsoft Access MVP 2006-2009
http://home.comcast.net/~cccsolutions/index.html

"Find a job that you love... and you'll never work a day in your life."
 
Thx, for this. I used this method before but because of the nessecity to do
a requery (and the screen blinking) on the form i hoped that a filter method
could be applied.

Ludovic
 
Hi all,

I was wondering; is it possible to apply a filter to a ListBox the same way
as is possible to a form recordsource?

Filter = "fID=1"
FilterOn=TRUE

Or are ther other methods so achieve the same?

Thx,
Ludovic

The usual way to get this effect is to construct a SQL string returning the
fields included in the listbox, with the desired criteria, and set the
listbox's Rowsource property to that SQL string. This implicitly does a
requery of the listbox.
 
Back
Top