易表在线答疑技术与交流用户社区 → [求助]If多了头就晕!


  共有5346人关注过本帖树形打印复制链接

主题:[求助]If多了头就晕!

帅哥哟,离线,有人找我吗?
132
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:165 积分:100 威望:0 精华:0 注册:2007/11/16 15:08:00
[求助]If多了头就晕!  发帖心情 Post By:2010/3/12 10:03:00 [只看该作者]

请帮忙看看下面的公式错在哪里?
If([确认]=-1,Eval("if(IsBlank(""" + Substitute(ListCols(GridName),"|",""") = True Or IsBlank(""") + """) = True,MsgBox(""此行内容填写不齐全,请检查!"",1,3) And SetCellText(GridName,Row,"确认",0), True )"),If(FindRow("现有存货","商品名称","=",[商品名称])>0,SetCellText("现有存货",[现有存货!RelationRow],"数量",[现有存货!数量]+[数量]) And SetCellText("现有存货",[现有存货!RelationRow],"进价",[进价]) And CopyRows("明细表","确认","=",-1) And DelFor(GridName,"确认","=",-1) And If(Text(Cell(1,3))="",SetCellText(GridName,1,3,Today()), True ) And MsgBox("已增加原商品数量!",0),If([确认]=-1 And FindRow("现有存货","商品名称","=",[商品名称])<=0,CopyRows("现有存货","确认","=",-1) And CopyRows("明细表","确认","=",-1) And DelFor(GridName,"确认","=",-1) And If(Text(Cell(1,3))="",SetCellText(GridName,1,3,Today()), True ) And MsgBox("新商品已入库!",0), True ))

谢谢!


 回到顶部
帅哥哟,离线,有人找我吗?
wjq1072
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:16190 积分:125850 威望:1 精华:0 注册:2006/8/12 12:29:00
  发帖心情 Post By:2010/3/12 12:02:00 [只看该作者]

原式:
If([确认]=-1,
Eval("if(IsBlank(""" + Substitute(ListCols(GridName),"|",""") = True Or IsBlank(""") + """) = True,MsgBox(""此行内容填写不齐全,请检查!"",1,3) And SetCellText(GridName,Row,"确认",0), True )"),
If(FindRow("现有存货","商品名称","=",[商品名称])>0,SetCellText("现有存货",[现有存货!RelationRow],"数量",[现有存货!数量]+[数量]) And SetCellText("现有存货",[现有存货!RelationRow],"进价",[进价]) And CopyRows("明细表","确认","=",-1) And DelFor(GridName,"确认","=",-1) And If(Text(Cell(1,3))="",SetCellText(GridName,1,3,Today()), True ) And MsgBox("已增加原商品数量!",0),If([确认]=-1 And FindRow("现有存货","商品名称","=",[商品名称])<=0,CopyRows("现有存货","确认","=",-1) And CopyRows("明细表","确认","=",-1) And DelFor(GridName,"确认","=",-1) And If(Text(Cell(1,3))="",SetCellText(GridName,1,3,Today()), True ) And MsgBox("新商品已入库!",0), True ))

更改:试试?
If([确认]=-1,
Eval("If(IsBlank("""+Substitute(Substitute(ListCols(GridName),"|确认",""),"|",""")= True Or IsBlank(""")+""")= True ,MsgBox(""此行内容填写不齐全,请检查!"",0) And SetCellText(GridName,Row,""确认"",0), True )"),
If([确认]=-1 And FindRow("现有存货","商品名称","=",[商品名称])>0,SetCellText("现有存货",[现有存货!RelationRow],"数量",[现有存货!数量]+[数量]) And SetCellText("现有存货",[现有存货!RelationRow],"进金额",[现有存货!进金额]+[进金额]) And CopyRows("明细表","确认","=",-1) And DelFor(GridName,"确认","=",-1) And If(Text(Cell(1,1))="",SetCellText(GridName,1,1,Today()), True ) And MsgBox("已增加原商品数量!",0),If([确认]=-1 And FindRow("现有存货","商品名称","=",[商品名称])<=0,CopyRows("现有存货","确认","=",-1) And CopyRows("明细表","确认","=",-1) And DelFor(GridName,"确认","=",-1) And If(Text(Cell(1,1))="",SetCellText(GridName,1,1,Today()), True ) And MsgBox("新商品已入库!",0), True )))


 回到顶部
帅哥哟,离线,有人找我吗?
132
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:165 积分:100 威望:0 精华:0 注册:2007/11/16 15:08:00
  发帖心情 Post By:2010/3/12 15:16:00 [只看该作者]

谢谢版主!
已经通过!

 回到顶部
帅哥哟,离线,有人找我吗?
132
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:165 积分:100 威望:0 精华:0 注册:2007/11/16 15:08:00
  发帖心情 Post By:2010/3/15 18:05:00 [只看该作者]

[这个贴子最后由132在 2010/03/15 06:22pm 第 1 次编辑]

版主您好!前面帮写的公式,运用时发现问题,现在我把文件传上来,请您费心看看,谢谢!
egd文件下载

 回到顶部
帅哥哟,离线,有人找我吗?
wjq1072
  5楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:超级版主 帖子:16190 积分:125850 威望:1 精华:0 注册:2006/8/12 12:29:00
  发帖心情 Post By:2010/3/15 18:41:00 [只看该作者]


 回到顶部
帅哥哟,离线,有人找我吗?
132
  6楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:论坛游民 帖子:165 积分:100 威望:0 精华:0 注册:2007/11/16 15:08:00
  发帖心情 Post By:2010/3/16 7:55:00 [只看该作者]

这下完全没有了问题.谢谢版主!

 回到顶部