Re: parameter query



Michel, that's just too clever. :-)

To handle the spaces a user might enter:
PARAMETERS WotNum Text ( 255 );
SELECT ClientNum
FROM tblClient
WHERE "," & Replace([WotNum], " ", "") & "," Like "*," & [ClientNum] & ",*";

Tested with a local table of 15k clients: quite usable performance.


Thanks for posting: you've provided my fun for this evening.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Michel Walsh" <vanderghast@VirusAreFunnierThanSpam> wrote in message
news:uE$F1P61IHA.524@xxxxxxxxxxxxxxxxxxxxxxx
There are some 'way around', but that can be slow.

A possible one is to pass the parameter: "12345,12348,12349"
(note there is no space after the comas)

And to use the query:
... WHERE ("," & parameter & ",") LIKE ("*," & id & ",*")

ie, use the field as a pattern and the parameter as left argument of LIKE. (Generally we do the reverse, the field is at the left and the parameter is the pattern, at the right, of the operator LIKE).

Vanderghast, Access MVP

"Allen Browne" <AllenBrowne@xxxxxxxxxxxxxx> wrote in message news:%23rFnOG61IHA.2384@xxxxxxxxxxxxxxxxxxxxxxx
No: you can't do that John. A parameter can only be a value; it cannot
be a mix of various values, separators, operators, ...

You could get the report you want by building a WhereCondition string to filter the report. Here's an example:
Use a multi-select list box to filter a report
at:
http://allenbrowne.com/ser-50.html

<jlute@xxxxxxxxxxxx> wrote in message
news:49fc650c-51e0-440e-adf8-4e8b2fbb5ab5@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I know how to create a parameter query. What I'd like to do is run a
parameter query that displays many child records of one parent record
that permits multiple parameter entries for the primary key. Can this
be done?

.



Relevant Pages

  • Re: parameter query
    ... You could get the report you want by building a WhereCondition string to ... Use a multi-select list box to filter a report ... parameter query that displays many child records of one parent record ... I can't see how this could be done via a parameter query. ...
    (microsoft.public.access.queries)
  • Re: parameter query
    ... You could get the report you want by building a WhereCondition string to filter the report. ... parameter query that displays many child records of one parent record ... I can't see how this could be done via a parameter query. ...
    (microsoft.public.access.queries)
  • Re: Filter for Report not working?????
    ... Do I need to release the filter or close the TableFame? ... contFilter DynArrayString ... Your first example based on ContractNo ... I decided to go with a table in PRIV for the report. ...
    (comp.databases.paradox)
  • Re: Show all records through combo box
    ... I should not have used the term report to describe what it is I ... was refering to is a MCReport. ... the subforms to the main form using the Company_ID and the MCReport_ID. ... There is no code in the filter section. ...
    (microsoft.public.access.forms)
  • Re: Show all records through combo box
    ... provided by an assortment of suppliers. ... If this basic model sounds like it would work, the report can be devised. ... the filter remains disabled. ... all of the other subforms change according to the MCReport selected ...
    (microsoft.public.access.forms)