Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共2 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:行定位选择find在窗口控件里如何实现?

1楼
菜鸟foxtable 发表于:2008/12/16 22:27:00


此主题相关图片如下:001.jpg
按此在新窗口浏览图片
如上图,根据ComboBox1的SelectIndexChanged事件进行表A的行定位,请老师们指导.
我的代码不行啊....搞到我晕晕的

Dim r,s As String
s = e.form.Controls("ComboBox1").value
r = DataTables("表A").Find(" & s & ", 0, 1, False, True, False)
If r > - 1 Then
        DataTables("表A").Select(r, .Colsel)
End If

 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:管理项目12.table



Find
 

在指定列中查找指定的字符内容,如果找到,返回行的位置,否则返回-1。

语法:
Find(StrFind, RowStart, Col, caseSensitive, fullMatch, Wrap)


示例一

在第一列查找“abc”,不区分大小写,不用完全匹配:

With CurrentTable
    Dim
r As Integer
   
r = .Find("abc", 0, 0
, False, False, True)
    If
r > - 1 Then '如果找到符合条件的行

        .Select(
r, .Colsel) '则选择该行

    End If
End With

[此贴子已经被作者于2008-12-16 22:49:21编辑过]
2楼
czy 发表于:2008/12/16 23:37:00
Dim r,s As String
s = e.form.Controls("ComboBox1").value
r = Tables("表A").Find( s , 0, 1, False, True, False)
If r > - 1 Then
    Tables("表A").Select(r,1)
End If
共2 条记录, 每页显示 10 条, 页签: [1]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .01953 s, 3 queries.