vb表达式返回#Error [英] vb expression returning #Error

查看:93
本文介绍了vb表达式返回#Error的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码在字段长度小于6时在报表单元格中放置#Error。 我一直在盯着这看,但没有看到错误。 

The following code puts a #Error in the report cell when the length of the field is less than 6.  I have been staring at this but do not see the error. 

如果字段长度> 9然后

If field length > 9 then

 用开头的空格分隔最后6个字符

  separate the last 6 chars from the beginning chars with a space

其他

 打印字段的长度。

  print the length of the field.

 如果字段长度小于10,则应该执行false逻辑。

 It should be executing the false logic if the field length is less the 10. 

= IIf(Len(Fields!ItemSku.Value)> 9,Left(Fields!ItemSku.Value,Len(Fields!ItemSku.Value)-6)+ Space(1)+ Right(Fields!ItemSku.Value,6), STR(LEN(Fields!ItemSku.Value)))

=IIf(Len(Fields!ItemSku.Value) > 9 ,Left(Fields!ItemSku.Value,Len(Fields!ItemSku.Value)-6) + Space(1) + Right(Fields!ItemSku.Value,6), STR(LEN(Fields!ItemSku.Value)))

以下是该字段中的一些值:

Here are some of the values in that field:

MP NAP601

MP NAP013

906PP CFC

TPRO JANMAR

X482526

X82

OGW400

OGW11461

OGW27040

9780982877524

9780944428917
$
9780981992839

MP NAP601
MP NAP013
906PP CFC
TPRO JANMAR
X482526
X82
OGW400
OGW11461
OGW27040
9780982877524
9780944428917
9780981992839

感谢您提前获得任何帮助!

Thanks for any help in advance!

推荐答案

尝试使用以下表达式:


=IIf(Len(Fields!ItemSku.Value) > 9 ,Left(Fields!ItemSku.Value,Len(Fields!ItemSku.Value)- IIF(Len(Fields!ItemSku.Value) >= 6,6,0)) + SPACE(1) + Right(Fields!ItemSku.Value,6), STR(LEN(Fields!ItemSku.Value)))


这篇关于vb表达式返回#Error的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆