設(shè)為首頁收藏本站Access中國

Office中國論壇/Access中國論壇

 找回密碼
 注冊

QQ登錄

只需一步,快速開始

返回列表 發(fā)新帖
樓主: roych
打印 上一主題 下一主題

[窗體] 【新手入門】之十七:淺談列表框的使用

[復(fù)制鏈接]
21#
發(fā)表于 2011-4-16 12:28:15 | 只看該作者
喜歡用列表框替代子窗體
22#
發(fā)表于 2011-4-16 13:30:57 | 只看該作者
學(xué)習一下
23#
發(fā)表于 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
24#
發(fā)表于 2011-6-8 23:23:46 | 只看該作者
學(xué)習一下
25#
發(fā)表于 2011-6-9 11:39:28 | 只看該作者
26#
發(fā)表于 2011-6-9 23:41:20 | 只看該作者
謝謝分享,學(xué)習一下
27#
發(fā)表于 2011-6-10 01:10:58 | 只看該作者
學(xué)習一下哈
28#
發(fā)表于 2011-6-11 10:09:38 | 只看該作者
這個有價值,我正好需要,感謝分享!
29#
發(fā)表于 2011-6-11 22:08:28 | 只看該作者
好東西
30#
發(fā)表于 2011-6-12 03:41:10 | 只看該作者
good

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則

QQ|站長郵箱|小黑屋|手機版|Office中國/Access中國 ( 粵ICP備10043721號-1 )  

GMT+8, 2025-7-13 07:56 , Processed in 0.101223 second(s), 33 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回復(fù) 返回頂部 返回列表