ComboBox ApplyFilter method

M

Michelle

Recently upgraded an Access 97 database to Access 2000. On
one of my user forms I have an unbound combo box; Row
Source is a query. I use the ApplyFilter method in the
AfterUpdate event. Problem: this will only work the first
time. Subsequent attempts no row is returned. I do not
even get an error message. Can you help?
Many thanks,
Michelle
 
G

Greg Casper

Michelle:

Are you resetting your filter after each use? If not, Access just compounds
the filters. In other words, if the first time through you set your filter
to

mycombobox.filter = "myform.employeeid = 121"
the the second time through you do this:

mycombobox.filter = "myform.employeeid = 122"

your filter is now

121 AND 122, which would return nothing if employeeid is key field.

Just be sure between uses that you reset your filter like this:

mycombobox.filter = ""

Hope this helps.

Greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top