以文本方式查看主题 - Foxtable(狐表) (http://foxtable.net/bbs/index.asp) -- 专家坐堂 (http://foxtable.net/bbs/list.asp?boardid=2) ---- [讨论]窗口按钮代码 (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=108352) |
||||
-- 作者:feng1999 -- 发布时间:2017/10/20 16:00:00 -- [讨论]窗口按钮代码 老师好,窗口1中有一个按钮检验记录数据是显示与之关联表的内容,如果tables(“电解电容检验记录录入”)中有相对应的录入内容(刚开始加载表的时候该表不加载内容,代码稍后增加),在此显示,如果没有录入内容,能否根据tables(”电解电容“”)中材料代号以及零缺陷的数量自动根据tables(“电解电容检验记录数据库”)中相对应的材料代号生成与零缺陷数量相同记录数量呢?
|
||||
-- 作者:有点甜 -- 发布时间:2017/10/20 16:21:00 -- Dim t As Table = Tables("电解电容") Dim cr As Row = t.Current Dim cs1() As String = {"供应商","日期","暂收单号","采购单号","材料代号"} Dim cs2() As String = {"外形尺寸_本体直径","外形尺寸_本体高","电容量测试值","损耗角正切测试值","漏电流测试值"} If cr.DataRow.GetChildRows("电解电容检验记录录入").count = 0 Then Dim drs = DataTables("电解电容检验记录数据库").Select("材料代号 = \'" & cr("材料代号") & "\'") If drs.count = 0 Then msgbox("没找到数据库") Else For j As Integer = 1 To cr("零缺陷数量") Dim ndr As DataRow = DataTables("电解电容检验记录录入").AddNew For i As Integer = 0 To cs1.length-1 ndr(cs1(i)) = cr(cs1(i)) Next Dim fdr = drs(Rand.Next(drs.count)) For i As Integer = 0 To cs2.length-1 ndr(cs2(i)) = fdr(cs2(i)) Next Next End If End If |