Re: setting query parameters for blocks at runtime

From: Steve Cosner <stevec_at_zimmer.csufresno.edu>
Date: Mon, 23 Aug 1999 18:51:28 GMT
Message-ID: <QKgw3.119$tS.3785_at_nntp.csufresno.edu>


In article <7prlfm$i22$1_at_bgtnsc03.worldnet.att.net>, Greg James <g.c.james_at_worldnet.att.net> wrote:
>I have seen examples of setting query parameters for a block at runtime by
>creating a string e.g., '# in (123, 124, 125) and then copying the string to
>a text item in the block's pre-query trigger. If the string is copied to
>the record_id text item, i assume that the string functions as a where
>clause, returning only records with record_id = 123, 124, and 125 when the
>base table is queried.
>
>Is it possible to narrow the query further by creating additional strings
> like the one mentioned above ) for other text items? For example could you
>copy the string '# in (jones, smith, doe)' to the customer_name text item
>and return records only were the record_id is 123, 124, 125 and the
>customer_name is jones, smith, doe?
>
>I have tried this, unsuccessfully so far, but thought that I might be
>syntaxing it wrong.

Yes, that is entirely possible. Forms just concatenates each of those with the AND logical operator as it builds a where clause. However in your example, '# in (jones, smith, doe)', it should look like:   # in ('jones','smith','doe')
And don't forget that upper or lower case makes a difference.

I am puzzled by your phrase "if the string is copied to the text item". Usually when you are using the '# in (1,2,3)', you are typing the string into the column on the form during Enter-Query mode. If you are doing it from a pre-query trigger from inside your form, then you have to worry about using two apostrophes in place of one where an apostrophe (the single quote) is required inside your text string.

Steve Cosner



http://members.aol.com/stevec5088
Downloadable Quick Access utility form: Display and update any table. Received on Mon Aug 23 1999 - 20:51:28 CEST

Original text of this message