求教:
Tcombobox控件如何关连Tedit,使选择Tcombobox时Tedit自动出现对应的数据
我的代码
begin
if comGoods.Text <> '' then
begin
adoQur.SQL.Clear;
adoQur.SQL.Add('select CarNumber from Goods where GoodsName=''' + comgoods.Text + '''');
adoQur.Open; if adoQur.RecordCount > 0 then
begin
editdistance.Text := adoQur.Fields[0].AsString;
end
else
begin
ShowMessage('..............);
end;
end;
end;
这样写对吗?为什么一运行就提示access参数不足,希望是1
Tcombobox控件如何关连Tedit,使选择Tcombobox时Tedit自动出现对应的数据
我的代码
begin
if comGoods.Text <> '' then
begin
adoQur.SQL.Clear;
adoQur.SQL.Add('select CarNumber from Goods where GoodsName=''' + comgoods.Text + '''');
adoQur.Open; if adoQur.RecordCount > 0 then
begin
editdistance.Text := adoQur.Fields[0].AsString;
end
else
begin
ShowMessage('..............);
end;
end;
end;
这样写对吗?为什么一运行就提示access参数不足,希望是1
在combobox的onchange事件中
edit1.text:=self.combobox1.text;