Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
With e.form
Dim sql,str1,kz As String
kz = "ComboBox3,ComboBox4,ComboBox1,TextBox2,DateTimePicker3,DateTimePicker4"
str1 = "审核状态='@$0',部门= '@$1',岗位= '@$2',责任人= '@$3',日期 >= #@$4#,日期 <= #@$5#"
Dim i As Integer
For Each k As String In kz.split(",")
If .Controls(k).Value IsNot Nothing Then
If i=0 And .Controls("CheckBox2").Checked Then
sql = sql & " AND " & str1.split(",")(i).Replace("='@$" & i," like '%" & .Controls(k).Value & "%")
Else
sql = sql & " AND " & str1.split(",")(i).Replace("@$" & i,.Controls(k).Value)
End If
End If
i += 1
Next
If sql > "" Then
Tables("现场检查").Filter = sql
End If
End With
出错说:
还有 上面代码中 i += 1 是原版华海仓库的 是错的 还是什么? 我觉得应该是i = i+1啊!
这样?
If i=0 And .Controls("CheckBox2").Checked Then
sql = str1.split(",")(i).Replace("='@$" & i," like '%" & .Controls(k).Value & "%' ")
Else
i+=1 和 i = i+1使一样的........