Foxtable(狐表)用户栏目专家坐堂 → [求助]当前列值等于窗口TextBox1的值自动录入到动态列


  共有728人关注过本帖树形打印复制链接

主题:[求助]当前列值等于窗口TextBox1的值自动录入到动态列

帅哥哟,离线,有人找我吗?
y2287958
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4723 积分:34352 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2024/8/5 7:57:00 [显示全部帖子]

TextChanged事件
Dim i As Integer = Tables("表A").ColSel
If e.Form.Controls("TextBox1").Text <> "" Then
    If i <> 0 Then
        DataTables("表A").ReplaceFor("动态列", "")
        Tables("表A").rows(i)("动态列") = e.Form.Controls("TextBox1").Text 
        Tables("表A").rows(i + 10)("动态列") = e.Form.Controls("TextBox1").Text 
    End If 
End If

 回到顶部
帅哥哟,离线,有人找我吗?
y2287958
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:狐神 帖子:4723 积分:34352 威望:0 精华:0 注册:2008/8/31 22:44:00
  发帖心情 Post By:2024/8/5 9:51:00 [显示全部帖子]

If e.Form.Controls("TextBox1").Text <> "" Then
    Dim 列名集 As New List(Of String)({"第二列", "第三列", "第四列"})
    Dim 当前列名 As String = Tables("表A").cols(Tables("表A").ColSel).Name 
    If 列名集.Contains(当前列名)Then
        DataTables("表A").ReplaceFor("动态列", "")
        DataTables("表A").ReplaceFor("动态列", e.Form.Controls("TextBox1").Text, 当前列名 & "=" & e.Form.Controls("TextBox1").Text)
    End If 
End If

 回到顶部