RE: Combo Box, filter values
- From: Maurice <Maurice@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 28 Feb 2009 07:06:02 -0800
Try changing your last SQL statement to:
"SELECT bedrijf FROM klanten WHERE bedrijf Like '*" & SearchWord & "*'" & "
ORDER BY bedrijf"
That is after the word Like you'll see one apostroph an asterisk and double
quotes. After the second & you'll find a double quote an asterisk a single
quote and a double quote.
That will do the trick you are looking for.
hth
--
Maurice Ausum
"Celfreak" wrote:
For a combo box I use a sql statement as basis..
SELECT Klanten.Bedrijf FROM Klanten ORDER BY Klanten.Bedrijf;
When I using the form, the list goes automatically to the name with the
(first) letters you type in the box. My problem is the list is getting bigger
and bigger, so I want to search in my combobox.
In SQL you can use the Where statement to narrow down the choices. For example
SELECT Klanten.Bedrijf FROM Klanten WHERE Klanten.Bedrijf Like '*BV*' ORDER
BY Klanten.Bedrijf; narrows down the list of the combobox the the values with
BV in their name.
This is a static statement and i want to make it more dynamic. What I want
is to have a (independent) field where you type your searchword that is used
by the combobox to narrow down the list. I tried many things, only I cannot
connect a field to the SQL statement.
What works is voor example
SELECT Klanten.Bedrijf FROM Klanten WHERE Klanten.Bedrijf Like '*'&
searchword &'*' ORDER BY Klanten.Bedrijf
I then get the message give parameter. Problem with this is that I cannot
change that parameter.
--
-
- References:
- Combo Box, filter values
- From: Celfreak
- Combo Box, filter values
- Prev by Date: RE: how to use print control on a form in access 2007
- Next by Date: RE: Split form in subform
- Previous by thread: Combo Box, filter values
- Next by thread: how to use print control on a form in access 2007
- Index(es):
Relevant Pages
|