数据库设计这样
中东 沙特
中东 科威特
亚洲 中国
亚洲 日本
用两个combobox,第一个combobox1中可以选择的是中东和亚洲,若combobox1选中中东,则combobox2才可用并只能出现沙特、科威特
如何实现?
我自己写的在combobox1中选择中东后,在combobox2中只出现一条记录,不知是什么原因?
中东 沙特
中东 科威特
亚洲 中国
亚洲 日本
用两个combobox,第一个combobox1中可以选择的是中东和亚洲,若combobox1选中中东,则combobox2才可用并只能出现沙特、科威特
如何实现?
我自己写的在combobox1中选择中东后,在combobox2中只出现一条记录,不知是什么原因?
if Combobox1.text<>'' then
begin
combobox2.clear;
combobox2.items.add('对应的项');
combobox2.items.add('对应的项');
...
end;
combobox2连接到DataSource
if Combobox1.text <>'' then
begin
combobox2.clear;
with adoquery1 do
begin
close;
sql.text := ' select t2 from 表 where t1=:t1';
parameters.parambyname('t1').value := trim(combobox1.text);
open;
while not eof do
begin
combobox2.items.add(fields[0].asstring);
next;
end;
end;
end;