以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教关于控件中,字符自动输入的问题  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=23855)

--  作者:kevin
--  发布时间:2012/9/21 18:55:00
--  请教关于控件中,字符自动输入的问题

以下代码:TextBox1录入内容后,TextBox2自动录入与之对应行的指定内容.但是没有实现.请帮忙

Dim txt As String = e.Form.Controls("TextBox1").value
Dim dr As DataRow
dr = DataTables("表A").Find("第一列 = " & "\'" & txt & "\'" )  
If dr IsNot Nothing \'如果找到, 则设置各列内容
    e.Form.Controls("TextBox2").value = dr("第二列")
End If

[此贴子已经被作者于2012-9-21 18:55:22编辑过]

--  作者:czy
--  发布时间:2012/9/21 19:05:00
--  

\'ValueChanged事件代码
Dim dr As DataRow
dr = DataTables("表A").Find("第一列 = \'" & e.Sender.Value & "\'" )  
If dr IsNot Nothing \'如果找到, 则设置各列内容
    e.Form.Controls("TextBox2").value = dr("第二列")
End If