设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
楼主: roych
打印 上一主题 下一主题

[窗体] 【新手入门】之十七:浅谈列表框的使用

[复制链接]
21#
发表于 2011-4-16 13:30:57 | 只看该作者
学习一下
22#
发表于 2011-4-16 13:37:20 | 只看该作者
列表框查询

Private Sub cmderq_Click()
On Error GoTo Err_cmderq_Click

    Dim strWhere As String
    strWhere = ""
   
    If Not IsNull(Me.Text1) Then
        strWhere = strWhere & "([yearmonth] like '" & Me.Text1 & "') AND "
    End If
    If Not IsNull(Me.Text2) Then
        strWhere = strWhere & "([codeno] like '*" & Me.Text2 & "*') AND "
    End If
    If Not IsNull(Me.Text3) Then
        strWhere = strWhere & "([area] like '" & Me.Text3 & "') AND "
    End If
    If Not IsNull(Me.Text4) Then
        strWhere = strWhere & "([place] like '*" & Me.Text4 & "*') AND "
    End If
    If Not IsNull(Me.Text5) Then
        strWhere = strWhere & "([customer] like '*" & Me.Text5 & "*') AND "
    End If
    If Len(strWhere) > 0 Then
        strWhere = Left(strWhere, Len(strWhere) - 5)
    End If
   
    strWhere = "select * from stock_q where " & strWhere
    Me.List1.RowSource = strWhere
    Me.List1.Requery
  
Exit_cmderq_Click:
    Exit Sub

Err_cmderq_Click:
    MsgBox Err.Description
    Resume Exit_cmderq_Click
End Sub
23#
发表于 2011-6-8 23:23:46 | 只看该作者
学习一下
24#
发表于 2011-6-9 11:39:28 | 只看该作者
25#
发表于 2011-6-9 23:41:20 | 只看该作者
谢谢分享,学习一下
26#
发表于 2011-6-10 01:10:58 | 只看该作者
学习一下哈
27#
发表于 2011-6-11 10:09:38 | 只看该作者
这个有价值,我正好需要,感谢分享!
28#
发表于 2011-6-11 22:08:28 | 只看该作者
好东西
29#
发表于 2011-6-12 03:41:10 | 只看该作者
good

30#
发表于 2011-6-13 19:20:01 | 只看该作者
1111
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-26 02:06 , Processed in 0.104844 second(s), 33 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表