红色部分怎么改都出错。。。
此主题相关图片如下:qq截图未命名.png
Dim Filter As String
With e.Form.Controls("编号")
If .Value IsNot Nothing Then
Filter = "编号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("身份证号")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "身份证号 = '" & .Value & "'"
End If
End With
With e.Form.Controls("姓名")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "姓名 = '" & .Value & "'"
End If
End With
With e.Form.Controls("乡镇")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "乡镇 = '" & .Value & "'"
End If
End With
With e.Form.Controls("村")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "村 = '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("主窗口_Table1").Fill("select * from F_JKDA where
" & Filter & "","JKData",True)
Else
MessageBox.Show("请输入条件!","提示")
End If
[此贴子已经被作者于2010-5-21 22:19:53编辑过]