Dim dr2 As Row =Tables("生产计划").Current'定义一个当前行(行有多列)Dim s As String =Format(dr2("发生年月"),"yyy年MM月")'指定的字符应该是对应Current行的具体的某列,3个Y?错误提示在这行
我是菜鸟,帮助文档看的还不熟,请参考。
可以测试下,如果不显示 2 那就是这句
Tables("生产计划").Current("编制人") = UserName
Dim dr2 As Row =Tables("生产计划").Current
MessageBox.Show(1)
Dim s As String =Format(dr2,"yyy年MM月")
MessageBox.Show(2)
Dim drs As List (of DataRow)=DataTables("领料明细").Select("领料单号='"&Tables("生产计划").Current("领料单号") &"'")
For Each dr As DataRow In drs
Dim dr1 As DataRow =DataTables("计划耗用结存").find("发生年月= '"
& s &
"
'and 部门='"&dr2("部门")&"'and 物料编码= '"&dr("物料编码")&"'")'这句里面合成表达式部分有的多空格 有的少空格
If dr1 IsNot Nothing AndAlso dr1("月末结余_投入数") < 0 Then‘判断空行
MessageBox.show("累计发出材料数量超过耗用定额,请找领导审批","提示")
'是否应该终止执行呢,要不后边就Save()了
exit for
End If
Next
Tables("材料领用").Current.Save()
DataTables("领料明细").Save()
动态合成表达式
http://www.foxtable.com/bbs/dispbbs.asp?BoardID=2&ID=43687&replyID=&skin=1