Use text box to filter list box - almost, but not quite...

  • Thread starter Thread starter Piers 2k
  • Start date Start date
P

Piers 2k

Hi folks,

Having problems with the Event Procedure...

Simple Form:
Text box (named text1) to enter criteria.
List box below (named list2), getting records from field in table.

Went into RowSource property of list box. Modified the criteria to this:
Like "*" & [Forms]![Form1]![Text1] & "*"

User can now type anything into the text box, click cmd button and
list1.requery works.

I'm trying to change it so that as the user types, it automatically filters
the list box. For some reason, putting it into the Change event has no
effect, except when I delete all the criteria?? I thought it should? If I
put it into something like AfterUpdate, it works fine once I tab out of the
text box, but that's not what I'm after.

Any ideas folks?

Thankx in advance,

Piers.
 
Tried it, but I get strange results.

The keyPress only seems to work when I TAB INTO the field.

I've tried KeyUp as well. This does the same as above? My machine seems
fine, but is it? Is CHANGE meant to do what I intend it to do.

Piers
 
I use a similar system (but filtering a subform rather than a list box) and
Change event works fine with that. Change should do exactly what you are
asking of it. Maybe there is some other setting (like an event on keypress)
that is interfering.

I'd move everything onto a new form in a new db just to check that there
isn't some conflict with other settings.
 
Back
Top