以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  关于自定义录入界面,填充到textbox 的问题  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=12432)

--  作者:yacity
--  发布时间:2011/9/2 15:44:00
--  关于自定义录入界面,填充到textbox 的问题

自定义录入界面中,填充数据到 表格中 有一段代码如下:

 


Dim tbl As Table = Tables("窗口3_Table1")
If e.KeyCode = Keys.Up Then
    tbl.Position = tbl.Position - 1
    e.Cancel = True
ElseIf e.KeyCode = Keys.Down Then
    tbl.Position = tbl.Position + 1
    e.Cancel = True
ElseIf e.KeyCode = Keys.Enter Then
    If tbl.Current IsNot Nothing Then
        Tables("zhidai").Current("ptypeid") = tbl.Current("ptypeid")
        Tables("zhidai").Current("pfullname") = tbl.Current("pfullname")
        Tables("zhidai").Current("Standard") = tbl.Current("Standard")
        Tables("zhidai").Current("Unit1") = tbl.Current("Unit1")
        Tables("zhidai").Current("price") = tbl.Current("price")
        Tables("zhidai").current("gongxu")=tbl.Current("gongxu")
        Tables("zhidai").current("shuliang")=0
    End If
    e.Cancel = True   
    e.Form.Close()
End If

 

如果 是填充数据到 窗口中的 textbox 中呢?

比如 ptypeid、 pfullname 等列 不是 在表格中的 ,而是窗口中的。 “销售录入”窗口中 pfullname 是textbox文本框控件。那么怎么填充 pfullname 呢?

 


--  作者:狐狸爸爸
--  发布时间:2011/9/2 16:08:00
--  

不同的窗口:

 

Forms("窗口名").Controls("TextBox1").Value = tbl.Current("ptypeid")

 

同一个窗口:

e.Form.Controls("TextBox1").Value = tbl.Current("ptypeid")