估计是函数嵌套问题,试用Eval解决:
If([%选择日期%]="" Or [%棉种类存%]="" Or [%业务员存%]="" Or [%克重存%]="" Or [%幅宽1%]=0,MsgBox("信息不全,请确认",1,1),Eval("Setvariable(""%棉种类编码%"","""+FindText("棉种类","棉种类编码","棉种类名称","=",[%棉种类存%])+""") And Setvariable(""%业务员编码%"","""+FindText("业务员","业务员编码","业务员名称","=",[%业务员存%])+""")") And openwindow(1))
如对Eval过敏,试把FindText("棉种类","棉种类编码","棉种类名称","=",[%棉种类存%])及FindText("业务员","业务员编码","业务员名称","=",[%业务员存%])设置为表达式变量,如:%MZL%,%YWY%
If([%选择日期%]="" Or [%棉种类存%]="" Or [%业务员存%]="" Or [%克重存%]="" Or [%幅宽1%]=0,MsgBox("信息不全,请确认",1,1),Setvariable("%棉种类编码%",[%MZL%]) And Setvariable("%业务员编码%",[%YWY%]) And openwindow(1))