类似access查找中的记忆功能-钱玉炜
Access软件网QQ交流学习群(群号码198465573),欢迎您的加入!
首页 >技术文章> 综合其它


类似access查找中的记忆功能

发表时间:2008/6/30 14:12:35 评论(0) 浏览(6529)  评论 | 加入收藏 | 复制
   
摘 要:类似Access查找中的记忆功能
正 文:

procedure TComLocateFrm.LocateBtnClick(Sender: TObject);
var
   setLoOptions : TLocateOptions;
   i : integer;
   slKeys : TStrings;
begin


  if ComboBox1.Items.IndexOf(ComboBox1.Text)<0 then
  try
    slKeys := TStringList.Create;
    slKeys.AddStrings(ComboBox1.Items);
    ComboBox1.Items.Clear;
    ComboBox1.Items.Add(ComboBox1.Text);
    for i := 0 to 8 do
      if i < slKeys.Count then
        ComboBox1.Items.Add(slKeys.Strings[i]);
  finally
     slKeys.Free;
  end
  else begin
    i := ComboBox1.Items.IndexOf(ComboBox1.Text);
    ComboBox1.Items.Insert(0,ComboBox1.Text);
    ComboBox1.Items.Delete(i+1);
    ComboBox1.ItemIndex := 0;
  end;

  if rdoExactly.Checked then
     setLoOptions := []
  else
     setLoOptions := [loPartialKey];
  if Not DesDataSet.Locate('ZTM', ComboBox1.Text, setLoOptions) then
     MessageBox(Handle, '没有找到符合条件的记录。', '提示', 0+64);
end;


Access软件网交流QQ群(群号:198465573)
 
 相关文章
自动记忆位置窗体例子  【咱家是猫  2008/8/21】
[Access示例]Access新增记录时复制上一条记录的示例\具...  【竹笛  2008/9/8】
【access小品】词组的自动记忆  【todaynew  2010/4/5】
关于如何记忆VBA代码  【竹笛  2012/10/4】
常见问答
技术分类
相关资源
文章搜索
关于作者

钱玉炜

文章分类

文章存档

友情链接