以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助] (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=127435) |
||||
-- 作者:mrlua88 -- 发布时间:2018/11/14 10:21:00 -- [求助]
关于关系表关系:父表【任务表】子表【学生表】孙表【明细表】 孙表【收款表】 通过选中学生表的某几行学生,点击【生成收款】,在孙表【收款表】上,以选中的学生生成一条收款记录? 已经通过, 以下内容为程序代码: 1 If Tables("窗口_任务表.学生表").Rows.Count > 0 Then 2 For Each r1 As Row In Tables("窗口_任务表.学生表").GetCheckedRows 3 Dim r2 As Row = Tables("收款表").AddNew 4 r2("任务单号") = r1("任务单号") 5 r2("学生编码") = r1("学生编码") 6 r2("应收金额") = r1("应收金额") 7 r2("应收金额") = r1("未收金额") 8 Next 9 DataTables("收款表").Save() 10 e.Form.close 11 Else 12 MessageBox.Show("提示") 13 End If 还是无法实现,觉得是存在关系的原因。大神指点指点
|
||||
-- 作者:有点甜 -- 发布时间:2018/11/14 10:26:00 -- If Tables("任务表.学生表").Rows.Count > 0 Then For Each r1 As Row In Tables("任务表.学生表").GetCheckedRows Dim r2 As Row = Tables("任务表.学生表.收款表").AddNew r2("任务单号") = r1("任务单号") r2("学生编码") = r1("学生编码") r2("收款金额") = r1("未付金额") Next DataTables("收款表").Save() Else MessageBox.Show("没有选择学生!") End If |