inherited; if trim(combobox1.Text)<>'' then with md do begin
{adogoods.First; combobox1.Items.Clear; while not adogoods.Eof do begin combobox1.Items.Add(adogoods.FieldValues['goodsname']); adogoods.Next; end; } adogoods.Locate('goodsname',combobox1.text,[loPartialKey]); adopos.Close; adopos.SQL.Clear; adopos.SQL.add('select top 1 * from T_goods where goodsname='''+combobox1.Text +''''); adopos.Open; adoquery1.close ; adoquery1.SQL.Clear; if radiobutton1.Checked then adoquery1.SQL.Add('select * from T_goods where number=-1') else adoquery1.SQL.Add('select * from T_goods where number<>-1'); adoquery1.Open; adoquery1.First; combobox1.Items.Clear ; while not adoquery1.Eof do begin combobox1.Items.Add(adoquery1.FieldValues ['goodsname']); adoquery1.Next; end; // combobox1.Text :=adogoods.FieldValues ['goodsname']; end;
if trim(combobox1.Text)<>'' then
with md do
begin
{adogoods.First;
combobox1.Items.Clear;
while not adogoods.Eof do
begin
combobox1.Items.Add(adogoods.FieldValues['goodsname']);
adogoods.Next;
end; }
adogoods.Locate('goodsname',combobox1.text,[loPartialKey]);
adopos.Close;
adopos.SQL.Clear;
adopos.SQL.add('select top 1 * from T_goods where goodsname='''+combobox1.Text +'''');
adopos.Open;
adoquery1.close ;
adoquery1.SQL.Clear;
if radiobutton1.Checked then
adoquery1.SQL.Add('select * from T_goods where number=-1')
else
adoquery1.SQL.Add('select * from T_goods where number<>-1');
adoquery1.Open;
adoquery1.First;
combobox1.Items.Clear ;
while not adoquery1.Eof do
begin
combobox1.Items.Add(adoquery1.FieldValues ['goodsname']);
adoquery1.Next;
end;
// combobox1.Text :=adogoods.FieldValues ['goodsname'];
end;
你这样光标只是在第二个了!
?
什么意思,你在响应事件里写了什么没有...不太懂你的意思