以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  两个列只能输入其中任意列的时候。。。  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=67723)

--  作者:jinzhengbe
--  发布时间:2015/4/30 0:32:00
--  两个列只能输入其中任意列的时候。。。


if e.DataRow("dc")  orelse e.DataRow("price") then
  e.DataRow("price")=e.DataRow("dc") *e.DataRow("markprice")/100
else 
 e.DataRow("dc") =e.DataRow("price")/ e.DataRow("markprice") 

end if


上面这段代码我想改一下


前提  有两个列  一个是 dc  一个是price

如果 用户输入 dc  则系统 自动 计算 price的值 price的值将会不能变动
如果 用户输入 price的值 则 系统自动计算 dc的值 dc的值将不会变动
两个值中如果有一个被输入其他一个就不能输入

上面的代码 只能输入dc的值 并计算price的值, 
不能输入 price的值 计算dc的值
而且 新增加行就直接关闭程序

请问怎么改,非常感谢 

--  作者:Bin
--  发布时间:2015/4/30 8:39:00
--  
SystemReady = False
if e.datacol.name ="dc" then
  e.DataRow("price")=e.DataRow("dc") *e.DataRow("markprice")/100
else if e.datacol.name ="price"
  e.DataRow("dc") =e.DataRow("price")/ e.DataRow("markprice") 
end if 
SystemReady = True

--  作者:jinzhengbe
--  发布时间:2015/4/30 13:08:00
--  

感谢感谢,非常感谢