Filter Listbox from Combo and Text Box

tl mike

Registered User.
Local time
Today, 09:12
Joined
Sep 7, 2007
Messages
117
I have a listbox that I would like filter using a combo box and a text box.

The list box should have everything listed at first and as the user enters something in either box then it should filter

For instance:
the combo box has sales persons name
the text box is used to enter the customers name

the list box shows the customers and allows the sales person to open the customers form.

The user should be able to filter by the combobox only, or by the text box, or both.

I have tried everything I can think of but the codes and the way that I am setting it up work agianst each other.

Does anyone have anything like this or can give me some insight I am using Access 2010 and I only know a little VBA?
 
For clarity:

How does the Listbox get populated?

The combo box has Sales person Name
One sales person or several? How does this get populated?

the text box is used to enter the customers name
This seems prone to typos and spelling mistakes. Why not let the user select the CustomerName from a Combo Box?

Maybe you should tell us in plain English WHAT you are trying to do - not HOW you have done or are attempting to do something.
 
Hi Jdraw thanks for the reply to answer your questions

How does the Listbox get populated?.

This is populated from a query

One sales person or several? How does this get populated?.

Only one sales person at a time this feature is to make it easier for the sales person to find thier customer. It is populated from the emplyees table.

This seems prone to typos and spelling mistakes. Why not let the user select the CustomerName from a Combo Box?.

The current one I am using is like OldSoftBoss's searching and sorting feature

http://www.access-programmers.co.uk/forums/showthread.php?t=110203&highlight=SEARCHING


Maybe you should tell us in plain English WHAT you are trying to do - not HOW you have done or are attempting to do something.

What I am trying to do is to give the sales people the ability to select only their customers instead of having to thumb through other sales peoples customers due to the fact many customers have very simalar names etc.

Only using the text search feature like the one we are currently using the OldSoftBoss search feature tends to make it difficult for the sales people when they are trying to get to the customers information during a phone call.

Again thanks for any insight in how to accomplish this
 
If the listbox is to show the customer list for the selected salesman, then try:

Code:
me.listboxname.rowsource = "SELECT [customername], " & _
    "FROM tablename " & _
    "WHERE [saleseman] = """ & me.salesman.value & """;"

You can look at your existing recordsource in SQL mode for the starter text, then play with it until it gives you what you need.
 
I have already tried something like that but i am unable to get the two inputs (combobox and textbox) to work together or only one at a time.

Attached is a sample of what I am trying to work on the
 

Attachments

I suspect that you should be able to adapt the principals demonstrated in the sample here. I wont be back on a machine with Access for about another week. However I think you should be able to treat a combo box in a similar manner as the option groups are treated in the sample.
 

Users who are viewing this thread

Back
Top Bottom