You are here:

Using MS Access/Updating ListBox contents as I type


Hi Scott,

I haven't done this for years, so completely forgotten.

I have a text field [MissingFilter] which I use as the RowSource for ListBox [ContentsList].

This is the code for the rowsource:
SELECT TblRmContents.ServiceDescription, TblRmContents.ServiceCode FROM TblRmContents;

What I would like to do is have Listbox [ContentsList] whittle down the choices as I type something into the text field {Missing Filter]

As in, if I type "b" the Listbox choices are reduced to all items starting with the letter B; if I continue to type, it whilttles down further, so by then typing "u", my list is narrowed down to anything starting with "bu", and so on.

I tried using a query as the row source, with this as the sql:

SELECT TblRmContents.ServiceDescription, TblRmContents.ServiceCode
FROM TblRmContents
WHERE (((TblRmContents.ServiceDescription) Like ([forms]![FrmAddRmServices]![MissingFilter])*"*"));

and on the text box added an event procedure to refresh on Key Down (didn't work), Key Press (didn't work) and gave up not knowing where to go next :)

Am I close?

thanks in anticipation


Use the On Change event of the text box.

Me.listbox.RowSource = "SELECT ServiceDescription, ServiceCode " & _
"FROM TblRmContents " & _
"WHERE (((ServiceDescription) Like " & Me.[MissingFilter]) & "'*'));"

Hope this helps,
Microsoft Access MVP 2007
Author: Microsoft Office Access 2007 VBA

Using MS Access

All Answers

Answers by Expert:

Ask Experts




I can answer almost all types of questions relating to Microsoft Access usage and application design. My strengths are database and interface design.


I've been designing databases for over 25 years working with dBase, FoxPro, Approach and Access.

Author of Microsoft Office Access 2007 VBA
Techncial Editor for Special Edition Using Microsoft Access 2007 and Access 2007 Forms, Reports & Queries From Que Publishing

Brooklyn College BA

©2017 All rights reserved.

[an error occurred while processing this directive]