以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- 明明控件的值存在但是就是有时候对的有时候给数据表的就是空值! (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=149278) |
-- 作者:jjun2002cn -- 发布时间:2020/4/28 0:28:00 -- 明明控件的值存在但是就是有时候对的有时候给数据表的就是空值! msgbox(Forms("产品输入").Controls("number").value & "_" & Forms("产品输入").Controls("Price").value) Tables("新建销售单_Sale_List").Current("ProductName")=Forms("产品输入").Controls("name").value Tables("新建销售单_Sale_List").Current("ProductID")=Forms("产品输入").Controls("ProductID").value Tables("新建销售单_Sale_List").Current("ProductNumber") = Forms("产品输入").Controls("number").value Tables("新建销售单_Sale_List").Current("ProductPrice") = Forms("产品输入").Controls("Price").value \'小计的价格自动运算 Tables("新建销售单_Sale_List").Current("MainMemoEx")=Forms("产品输入").Controls("MainMemoEx").value Tables("新建销售单_Sale_List").AddNew() \'添加数据后,清空 Forms("产品输入").Controls("name").value=Nothing Forms("产品输入").Controls("ProductID").value=Nothing Forms("产品输入").Controls("number").value=Nothing Forms("产品输入").Controls("Price").value=Nothing Forms("产品输入").Controls("ProductTotal").value=Nothing e.Form.Controls("DropBox1").text=Nothing 做的弹出窗口输入销售明细,ProductNumber 和 ProductPrice 这两个字段大部分时候是好的 就是有时候 2个中的一个是空值 也不报错 为了跟踪错误 我加了一个弹出框看赋值前是不是数据有问题 ,发现赋值前的数据没有问题 每次出现空值的时候 弹出框的数据是对的。 Tables("新建销售单_Sale_List") 的dataTable是用一下命令生成的临时表: Dim dtb As New DataTableBuilder("产品明细") dtb.AddDef("ProductID", Gettype(String), 32) dtb.AddDef("ProductName", Gettype(String)) dtb.AddDef("ProductNumber", Gettype(Double)) dtb.AddDef("ProductPrice", Gettype(Double)) dtb.AddDef("ProductTotal", Gettype(Double),"ProductNumber * ProductPrice") dtb.AddDef("MainMemoEx", Gettype(String)) dtb.Build() Tables("新建销售单_sale_list").DataSource =DataTables("产品明细") \'dtb.BuildDataSource() Tables("新建销售单_sale_list")这个表设置的是作为副本 困在这里几天了 不敢往后写,有时候对有时候不对折磨人的!请版主援手! |
-- 作者:有点蓝 -- 发布时间:2020/4/28 8:34:00 -- 把value改为text,如:Forms("产品输入").Controls("name").Text |