粉晶价格是多少钱一克:无效的过程调用或参数....请高手指点

来源:百度文库 编辑:高考问答 时间:2024/05/03 07:01:28
Out(4) = Space(46 - LenB(StrConv(txtdw, vbFromUnicode)))

我运行VB就告诉我
实时错误'5':
无效的过程调用或参数

请高手指点帮助解决一下
If Dir(文件) <> "" Then
Kill 文件
End If
Open 文件 For Output As #1
Adodc1.Refresh
Do While Not Adodc1.Recordset.EOF
txtdw = txtfields(7).Text
txtlxr = txtfields(8).Text
txtdh = txtfields(9).Text
打印小
Adodc1.Recordset.MoveNext
If txtdw <> txtfields(7).Text Or Adodc1.Recordset.EOF Then
lxr = Left(txtlxr, 4)
Out(4) = Space(46 - LenB(StrConv(txtdw, vbFromUnicode)))
Out(5) = Space(8 - LenB(StrConv(lxr, vbFromUnicode)))
Print #1, "憙" + "▲单位:" + txtdw + Out(4); "联系人:" + lxr + Out(5); "电话:" + Left(txtdh, 21)
End If
Loop
Close #1

这个是较完整的代码

Out(4) = Space(46 - LenB(StrConv(txtdw, vbFromUnicode))) 我运行上面的代码后就告诉我出错了....

你单步调试到Out(4) = Space(46 - LenB(StrConv(txtdw, vbFromUnicode))) 时出错?有可能你46-了一个比46大的数,也就是space(负数),在我的机器上就是这样,space(-1)的错误信息和你的一样