RE: Access 07 Use multiselect listbox to filter report
- From: Asib <Asib@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 26 Sep 2008 10:00:01 -0700
Yeah the first solution didnt work. But the concatenation worked great. I
still have to do some more testing but all looks good. I made a seperate
query to base the report and Listbox off of. My main query deals with nulls
in the sub field and i didnt feel like messing with it. It only opens in SQL.
And i changed the rowsource of the listbox from Select from Item master to
Select distinct from the New Query.Expr1. So thank you for all your help, it
is greatly appreciated. But while i have your focus i have one more question
if i may. i am now trying to create a Find As You Type Function for the
MultiSelect Listbox. From what i am reading i dont think it can be done.
There are just alot of [ItemNumbers] and scrolling seems like a waste of
time. Ive copied the module from Allen Brownes site but it states that it
doesnt work with unbound controls.
If i have to scroll so be it. But again thanks for the help.
"code_monkey_number_9" wrote:
Based on the error you are receiving, it sounds as if the hack is executing.
prematurely. It needs to execute AFTER this block:
'Remove trailing comma. Add field name, IN operator, and brackets.
lngLen = Len(strWhere) - 1
If lngLen > 0 Then
strWhere = "[ItemNumber] IN (" & Left$(strWhere, lngLen) & ")"
lngLen = Len(strDescrip) - 2
If lngLen > 0 Then
strDescrip = "Quotebook: " & Left$(strDescrip, lngLen)
End If
End If
BUT, based off your explanation of what you are doing, I no longer believe
this will work for you. If I am reading that correctly, your query needs to
return values based on pairs of data, e.g. B784 & Green, B784 & Blue, etc.
While the method above would return those values, it would also return B784 &
Purpl, if that record existed.
So what I think you could do instead is create a concatenated field in the
query that fills your multi-select listbox:
"Select ItemNumber & ItemColor As ItemNumberColor, ItemNumber, ItemColor
From ...". Use this field as the bound column, and include the same field in
qryMain. Then restructure Allen's code to build the where clause from that.
You no longer need the hack.
Does that make any sense?
- References:
- RE: Access 07 Use multiselect listbox to filter report
- From: code_monkey_number_9
- RE: Access 07 Use multiselect listbox to filter report
- Prev by Date: Re: Position subform control in relation to another
- Next by Date: RE: findfirst then findnext
- Previous by thread: RE: Access 07 Use multiselect listbox to filter report
- Next by thread: RE: WHERE Clause
- Index(es):
Relevant Pages
|