以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- 窗口中复选框 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=175433) |
-- 作者:胡噜胡噜毛 -- 发布时间:2022/3/4 11:39:00 -- 窗口中复选框 窗口中显示学生名单表,通过复选框选择多条记录,怎么自动写入住宿学生表中(勾选的自动增加,去掉勾选的自动删除) If e.Row.Checked Then Dim Cols1() As String = {"年级","班级","姓名","性别","联系电话"} Dim Cols2() As String = {"年级","班级","姓名","性别","联系电话"} For Each dr1 As Row In Tables("学生名单").GetCheckedRows Dim dr2 As DataRow = DataTables("住宿学生").AddNew() For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = dr1(Cols1(i)) Next Next End If |
-- 作者:有点蓝 -- 发布时间:2022/3/4 11:58:00 -- If e.Row.Checked Then Dim Cols1() As String = {"年级","班级","姓名","性别","联系电话"} Dim Cols2() As String = {"年级","班级","姓名","性别","联系电话"} Dim dr2 As DataRow = DataTables("住宿学生").AddNew() For i As Integer = 0 To Cols1.Length -1 dr2(Cols2(i)) = e.Row(Cols1(i)) Next else DataTables("住宿学生").deletefor("年级=\'" & e.Row("年级") & "\' and 班级=\'" & e.Row("班级") & "\' and 姓名...参考自己加上..") End If
|
-- 作者:胡噜胡噜毛 -- 发布时间:2022/3/4 16:59:00 -- 如何通过组合框筛选不同数据,比如组合框中选择2021级1班,下面的table中出现相应班级的名单 Dim txt As String = e.Form.Controls("ComboBox1").Text Dim tbl As Table = Tables("住宿学生_table1") If txt = "" Then tbl.Filter = "" Else txt = "\'%" & txt & "%\'" tbl.Filter = "班级 Like " & txt & " " DataTables("住宿学生_table1").ReplaceFor("_locked", False, "") End If [此贴子已经被作者于2022/3/4 17:00:17编辑过]
|
-- 作者:有点蓝 -- 发布时间:2022/3/4 17:15:00 -- 就是这个用法。有什么问题? |
-- 作者:胡噜胡噜毛 -- 发布时间:2022/3/4 17:33:00 -- 不存在 住宿学生_table1 的控件 |
-- 作者:有点蓝 -- 发布时间:2022/3/4 17:50:00 -- 如果不是副本改为主表名称 如果是副本 Tables("住宿学生_table1").datatable.ReplaceFor("_locked", False, "")
|
-- 作者:胡噜胡噜毛 -- 发布时间:2022/3/7 8:11:00 -- [此贴子已经被作者于2022/3/7 8:15:35编辑过]
|
-- 作者:胡噜胡噜毛 -- 发布时间:2022/3/7 8:18:00 -- 成功了,谢谢 |