Private Sub 种类1_AfterUpdate()
Dim ctlList As Control
Dim varItem As Variant
Dim strString As String
Dim strSQL As String
Set ctlList = Me.种类1
For Each varItem In ctlList.ItemsSelected
strString = strString & " Or 种类id=" & ctlList.ItemData(varItem)
Next
If strString = "" Then
strSQL = "SELECT * FROM xy入库单明细"
Else
strString = Right(strString, Len(strString) - 4)
strSQL = "SELECT * FROM xy入库单明细 WHERE " & strString
End If
Me.xy入库单明细子窗体.Form.RecordSource = strSQL
Me.xy入库单明细子窗体.Requery
End Sub
[此贴子已经被作者于2006-2-25 21:38:29编辑过]
|