|
wyh99999 发表于 2011-10-9 22:28
请教:如何处理词组之间的关系?
Function cx(str As String)
Dim strWhere As String '定义条件字符串
Dim A
Dim i As Long
Dim B As Boolean
B = IsNull(Me.tm.Value) = False
B = B And IsNull(Me.AOA.Value) = False
If B = True Then
If InStr(Me.AOA.Value, "与") > 0 Then
strWhere = "True"
Else
strWhere = "False"
End If
A = Split(Me.tm.Value, str)
For i = 0 To UBound(A, 1)
If A(i) <> "" Then
If InStr(Me.AOA.Value, "与") > 0 Then
strWhere = strWhere & " and ([题名]&[责任者]&[档号] Like '*" & A(i) & "*')"
Else
strWhere = strWhere & " or ([题名]&[责任者]&[档号] Like '*" & A(i) & "*')"
End If
End If
Next
If InStr(Me.AOA.Value, "非") > 0 Then
strWhere = "not (" & strWhere & ")"
End If
Else
strWhere = "True"
End If
Me.查询__综合_子窗体.Form.Filter = strWhere
Me.查询__综合_子窗体.Form.FilterOn = True
End Function |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|