Subject Re: Need help with a non-unique idea
Author Steve Fields
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 11:42 AM 29/07/2007, you wrote:
> >Hi all,
> >
> > I have this idea on how I can limit how a
> >user can select from a given list/table of
> >user information by selecting a starting letter
> >from another table and linking the two somehow.
> >
> > What I have is a table that is defined as follows,
> >USERID Integer, LASTNAME String(30), FIRSTNAME String(20),
> >etc.
> >
> > I have defined a TIB_Query that runs as so:
> >
> >SELECT SUBSTR(LASTNAME, 1, 1) AS CO
> >FROM USERINFO
> >ORDER BY LASTNAME
> >
> > This does give me a list of single letters for each
> >group of people in the list with the same last initials.
> >
> > My problem is this, of course, how do I link it back
> >to a second TIB_Query using MasterKey/Mastersource so that
> >when I scroll through the list of Initials it will cause
> >the second table to only show the ones in the table with
> >the matching first query's selected record/initial.
>
> Suppose the first query is called qry1.
>
> Make the second query (qry2) a parameterized one like:
>
> select lastname, x, y, z, etc. from userinfo
> where lastname starting with :initial
>
> Set the Mastersource for qry2 to the ib_datasource of qry1 but don't
> set any MasterLinks.
>
> Set the MasterParamLinks for qry2 as:
>
> initial=qry1.co
>
> Helen
>
Perfect!!! Thanks again Helen!!

Steve Fields