核心代码如下
sele 2
use 调价单
sele 1
use 图书订购
index on 书号 to 书号
update on 书号 from 调价单 repl 单价 with b->单价 random
repl all 金额 with 数量*单价
其他就简单了吧
sele 2
use 调价单
sele 1
use 图书订购
index on 书号 to 书号
update on 书号 from 调价单 repl 单价 with b->单价 random
repl all 金额 with 数量*单价
其他就简单了吧
1、先把 图书定购 和 调价单 两表的书号建索引。
use 图书定购
index on 书号 tag 书号
use 调价单
index on 书号 tag 书号或use 表后用modi stru 来手工修改
2 建立关系
use 图书定购 in 1 order 书号
use 调价单 in 2 order 书号
sele 图书定购
set rela to 书号 into 调价单
repl all 单价 with 调价单. 单价,金额 with 数量*单价
3、显示在Grid1上(Grid1的datasource已绑定了 图书定购)
thisform.grid1.refresh 搞掂了吧!!!分分分,100分