Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
我想在TextBox中实现模糊查询,需要将下面这段代码如何修改?应该放在哪个事件下?请指点一下,谢谢。
If e.IsFocusCell And e.Col.name = "textbok2" Then
Forms("供应商").Open()
End If
我已经将下面代码放在了Textchanged下
If Forms("供应商").Opened Then
Dim txt As String = e.Form.Controls("TextBox2").Text
Dim tbl As Table = Tables("供应商_Table1")
If txt = "" Then
tbl.Filter = ""
Else
txt = "'*" & txt & "*'"
tbl.Filter = "供应商编号 Like " & txt & " Or 供应商 Like " & txt
End If
End If
将下面代码放在了Leave下
Forms("供应商").Close()
将下面代码放在了keydown下
If Forms("供应商").Opened Then
Dim t As Table = Tables("供应商_Table1")
If e.keycode = keys.Down
t.position = t.Position +1
e.Cancel = True
ElseIf e.keycode = keys.up
t.position = t.Position -1
e.Cancel = True
ElseIf e.Keycode = keys.Enter
e.Form.Controls("TextBox2").Text = t.Current("供应商")
Forms("供应商").close()
End If
End If
狐狸爸爸,你教我看的帮助文件,我看了半天,相临的章节都看了,还是没有找出解决问题的办法。你是不是建议我采用树目录的方法来解决吗?我们的客户有1000多家,用树目录录入不太现实啊。