以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助] SelectedIndexChanged事件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=99812)

--  作者:积水成渊
--  发布时间:2017/4/27 11:05:00
--  [求助] SelectedIndexChanged事件
我要写一段代码在SelectedIndexChanged事件中去获取表table1中选中字段(商品编码)的内容,下面是我写的代码,但是报错。

Dim tb As WinForm.Table = e.Form.Controls("Table1")

Dim txt As String =  e.Table.Current("商品编码")

我该怎么去修改

[此贴子已经被作者于2017/4/27 11:05:45编辑过]

--  作者:有点蓝
--  发布时间:2017/4/27 11:13:00
--  

Dim tb As Table = e.Form.Controls("Table1").Table

if tb.Current isnot nothing then

    Dim txt As String =  tb.Current("商品编码")

end if


--  作者:积水成渊
--  发布时间:2017/4/27 11:35:00
--  
感谢有点蓝老师!