设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查找列表框中符合条件记录的函数[原创]

2007-11-16 14:15| 发布者: fannky| 查看: 894| 评论: 110

第一种: 使用方法UnAbs(列表框名,列数,查找字符) 返回结果:包含True,不包含False [hide] Function UnAbs(ListName As ListBox, N As Integer, KeyWord As String) As Boolean Dim I As Integer Dim S As Integer For I = 1 To ListName.ListCount - 1 If ListName.Column(N, I) = KeyWord Then S = S + 1 Next If S > 0 Then UnAbs = True Else UnAbs = False End If End Function [/hide] 第二种: 使用方法UnAbs(列表框名,列数,查找字符) 返回结果:符合指定条件的条数,数值型 [hide] Function UnAbs(ListName As ListBox, N As Integer, KeyWord As String) As Integer Dim I As Integer Dim S As Integer For I = 1 To ListName.ListCount - 1 If ListName.Column(N, I) = KeyWord Then S = S + 1 Next UnAbs=S End Function [/hide] 雕虫小技,不过抛砖引玉 稍加变更即可实现[color=red]模糊搜索[/color]以及[color=red]搜索结果定位[/color]显示 [[i] 本帖最后由 fannky 于 2007-11-17 14:07 编辑 [/i]]详细内容:http://www.office-cn.net/forum.php?mod=viewthread&tid=57711
发表评论

最新评论

查看全部评论(110)

相关分类

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-12-1 18:07 , Processed in 0.066780 second(s), 16 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

返回顶部