|
一段实例的代码,自己消化一下,对你一定有帮助
Private Sub 工地_Click()
Set ctl = Me![工地]
For Each varItm In ctl.ItemsSelected '取得复选之每一工地名称
a = a & " or local like " & Chr(39) & ctl.ItemData(varItm) & Chr(39)
Next varItm
If a <> "" Then
If IsNull(Me![厂商]) Then '取得日期及厂商名称
a = "inday =#" & Me![计日] & "#" & Right(a, Len(a) - 4)
Else
a = "inday =#" & Me![计日] & "# and fid like " & Chr(39) & _
Me![厂商] & Chr(39) & " and (" & Right(a, Len(a) - 4) & ")"
End If
Me![厂商别_子窗体].Form.Filter = a
Me![厂商别_子窗体].Form.FilterOn = True
End If
End Sub |
|