Subject | Passing the list 'row' from a TIB_LookupCombo to a TIB_Query |
---|---|
Author | dba@febc.org.ph |
Post date | 2001-10-17T08:25:57Z |
Hi,
With two tables, PROGRAMS and TALKBACK (live radio shows) as follows:
PROGRAMS
LANGUAGE
PROGRAM
LANG_NAME
PROGRAM_NAME
TALKBACK
PROGRAM
DATE_CALLED
NAME
SEX
AGE
LOCATION
On form create, the list in the TIB_LookupCombo is resolved by a
TIB_Query (IB_Query_Programs), with SQL
SELECT PROGRAM, PROGRAM_NAME FROM PROGRAMS where language =
'TGL'.
There is an OnChange event in the TIB_LookupCombo which executes
another query as IB_Query_Talkback.Open;
The SQL for _that_ query is "SELECT * FROM TALKBACK where PROGRAM =
'PEW'. This is displayed in a TIB_Grid
It all works fine, the rows for PROGRAM = 'PEW' are displayed in the
TIB_Grid correctly. Now I want to take it one stage further (I'm
learning), and pass a parameter (or similar) to the TIB_Query
(IB_Query_Talkback), so that the 'hard coded' SQL (PROGRAM = 'PEW') is
set to the PROGRAM from the TIB_LookupCombo.
Resulting in a TIB_Grid display change, when the user selects a
different program from the TIB_LookupCombo. How do you do this ? No
doubt because the SQL is a property setting, I just change the
property for that object, but where do I do this ?
Thanks,
Peter
PS What conventions should I use when describing objects ? For
example if it is a TIB_Query, with a name of IB_Query_Programs, is
TIB_Query (IB_Query_Programs) suitable ?
What about connections, tables and query names, what conventions do
people follow ?
With two tables, PROGRAMS and TALKBACK (live radio shows) as follows:
PROGRAMS
LANGUAGE
PROGRAM
LANG_NAME
PROGRAM_NAME
TALKBACK
PROGRAM
DATE_CALLED
NAME
SEX
AGE
LOCATION
On form create, the list in the TIB_LookupCombo is resolved by a
TIB_Query (IB_Query_Programs), with SQL
SELECT PROGRAM, PROGRAM_NAME FROM PROGRAMS where language =
'TGL'.
There is an OnChange event in the TIB_LookupCombo which executes
another query as IB_Query_Talkback.Open;
The SQL for _that_ query is "SELECT * FROM TALKBACK where PROGRAM =
'PEW'. This is displayed in a TIB_Grid
It all works fine, the rows for PROGRAM = 'PEW' are displayed in the
TIB_Grid correctly. Now I want to take it one stage further (I'm
learning), and pass a parameter (or similar) to the TIB_Query
(IB_Query_Talkback), so that the 'hard coded' SQL (PROGRAM = 'PEW') is
set to the PROGRAM from the TIB_LookupCombo.
Resulting in a TIB_Grid display change, when the user selects a
different program from the TIB_LookupCombo. How do you do this ? No
doubt because the SQL is a property setting, I just change the
property for that object, but where do I do this ?
Thanks,
Peter
PS What conventions should I use when describing objects ? For
example if it is a TIB_Query, with a name of IB_Query_Programs, is
TIB_Query (IB_Query_Programs) suitable ?
What about connections, tables and query names, what conventions do
people follow ?