procedure TForm1.ComboBox1Change(Sender: TObject);
begin
DBComboBox1.DataField := ComboBox1.Text;
end;
begin
DBComboBox1.DataField := ComboBox1.Text;
end;
解决方案 »
- DBGrid的使用,关于自动填写数据的问题
- 用DBgrid显示出数据后,可否象excel一样,选定一行或多行,点右键即可复制这一行或多行?,全选也可点右键全复制?
- 看看..
- 在csdn首页有篇文章提到在Delphi7.0中有Delphi for .NET的预览版,可我安装后没有找到,应该怎样安装呢?
- ▲▲▲连开三帖求答案!!!,RichEdit显示GIF动画?▲▲▲
- 如何让quickrep中的QRDBtext自动换行,我设了wordwrap属性为TRUE,但为什么还是不行?
- delphi6中的smtp中的host应是什么
- 在线等待,菜鸟问题,请帮忙!
- 谁能提供一些搞笑照片的网址
- Delphi中要怎栏才能CLOSE一个空数据集?
- 构建了procedure过程,运行时出现“无效字符”错误提示?
- 程序中怎样用word来编辑文本
procedure TForm1.Combobox1Change(Sender: TObject);
begin
DBCombobox.items.Clear;
query1.Close;
query1.sql.Clear;
query1.SQL.Add('SELECT DISTINCT * FROM "*.DB" WHERE (Deptmentname = '''+Combobox.text+''')');
query1.Prepare;
query1.Active:=true;
if not query1.IsEmpty then
begin
repeat
DBCombobox.items.add(query1['field']);
query1.Next;
until query1.eof;
spec.Text:=spec.Items[0]; 很笨的方法,但是可以运行
procedure TForm1.Combobox1Change(Sender: TObject);
begin
DBCombobox1.items.Clear;
query1.Close;
query1.sql.Clear;
query1.SQL.Add('SELECT DISTINCT * FROM "*.DB" WHERE (Deptmentname = '''+Combobox1.text+''')');
query1.Prepare;
query1.Active:=true;
if not query1.IsEmpty then
begin
repeat
DBCombobox.items.add(query1['field']);
query1.Next;
until query1.eof;
DBCombobox1.Text:=DBCombobox1.Items[0]; 很笨的方法,但是可以运行
query1.SQL.Add('SELECT DISTINCT '+Combobox.text+' FROM "*.DB" ');