Excellent and it works... I'm pretty happy about this point. This has been
pretty frustrating but you certainly made my day. Thank you so much.... Dave
Now, for one last question. Can you suggest a way to filter the combo box
to display only those records with 'villa' in the street so the user can then
select the correct one?
:
Hi Dave,
"When the user types in 'villa' with quotes..."
the user would NOT type the quotes, only the text to filter on ...
correction:
mFilter = "[defendant addressm] Like ""*" _
& Me.cboquicksearch & "*"""
or
mFilter = "[defendant addressm] Like '*" _
& Me.cboquicksearch & "*'"
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
have an awesome day
*
Dave wrote:
actually, my combo box produces a huge list of 5000 plus records. When the
user types in 'villa' with quotes, I'd like the combo box to only display
those records with 'villa' in the address line. From there, the user could
select the record they want to make current. Hope this clarifies what I'm
trying to do. I sure appreciate your help. Thanks
:
Hi Dave,
no extra spaces in the mask
use the word 'Like' instead of equal sign if you have a mask
if you use double quotes to surround the mask, you must use TWO of them
since you are using double quotes to delimit your filter
put this in the [Event Procedure] of the AfterUpdate event of
cboquicksearch
'~~~~~~~~~~~~~
dim mFilter as string
if isnull(me.cboquicksearch) then
'show all records
me.FilterOn = false
else
mFilter = "[defendant addressm] Like """*" _
& Me.cboquicksearch & "*"""
me.filter = mFilter
me.FilterOn = true
end if
me.requery
'~~~~~~~~~~~~~
if your data will not contain a single quote, you can also do this:
mFilter = "[defendant addressm] Like "'*" _
& Me.cboquicksearch & "*'"
WHERE
'defendant addressm' is the name of your field and its data type is text
BUT ... if you are using a combobox, I assume you are giving the user a
list of addresses to pick from. If they choose a complete address, you
do not need to use LIKE
mFilter = "[defendant addressm] = "'" _
& Me.cboquicksearch & "'"
Warm Regards,
Crystal
Access Basics
8-part free tutorial that covers essentials in Access
http://www.AccessMVP.com/strive4peace
*
have an awesome day
*
Dave wrote:
I didn't start the string but my question is the same. I haven't found the
answer and can't locate a source. Hopefully someone here can help. I'm
using an unbound combo box on a form. I want the user to type in a partial
address and have the combo box filter only those records that have what the
user typed in.
My code is wrong.
Me.Filter = "[defendant addressm]= "" * " & Me.cboquicksearch & " * """
Me.FilterOn = True
I can't get the filter to work. "the text you entered isn't an item on the
list" is the error message I get.
Can someone help me out....?
Thanks in advance.
Dave
:
hi zeroneux (what is your name?)
"how to filter my database?"
do you have unbound comboboxes/textboxes in, for instance, the header of
a form? What are the control names? what are the fieldnames in the
form RecordSource that they correlate to?
.... or is this an unbound form you are using for reporting?
please provide more details, thank you
Warm Regards,
Crystal
*
have an awesome day
*
zeroneux wrote:
can someone please help me how to filter my database? i need to filter it by
placing a combo box "company names" (contains name of clients, under the
names are status report for each) and placing date range of status you want
to view. is this possible? hope someone can help me.. thanks.