Dim mc As WinForm.TextBox = e.Form.Controls("tb_mc")
Dim th As WinForm.TextBox = e.Form.Controls("tb_th")
Dim cz As WinForm.TextBox = e.Form.Controls("tb_cz")
Dim cllb As WinForm.ComboBox = e.Form.Controls("cb_cllb")
DataTables("H_J_CODE").Load()
If cllb.Text Is Nothing Or cllb.Text.Length=0 Then
Tables("H_J_CODE").Filter="CODE like '*" & th.Text & "*' and name like '*" & mc.Text & "*' and CZ like '*" & cz.Text & "*'"
Else
Tables("H_J_CODE").Filter="CODE like '*" & th.Text & "*' and name like '*" & mc.Text & "*' and CZ like '*" & cz.Text & "*' and gystype='" & cllb.Text & "'"
End If
Tables("H_J_CODE").Sort = "CODE"
红色字体部分为刚添加的。能解决我刚才说的那种情况。只是有个疑问:是这种做法吗?会不会影响效率?
因为我不知道数据库里数据什么时候会变,是不是每次查询操作之前都要重新加载??
感谢解答!